I using slate for shopify theme developement.
Slate : https://github.com/Shopify/slate
node -v : v10.16.0
npm -v : 6.9.0
slate -v : 0.14.0
Followed follwoing step
1) slate theme mydemo
2) slate build (created dist folder)
3) slate zip (upload this theme on shopify store and get theme id.)
4) set store, password, theme id in config.yml file.
5) slate deploy
6) slate watch
Get error in complied dist folder Uncaught ReferenceError: $ is not defined in dist/assets/theme.js at line number 274 slate.Sections.prototype = $.extend({}, slate.Sections.prototype, {
https://jsrajyaguru.myshopify.com/products/650c-micro-wheelset when I change variation from dropdown price and product image not change due to javascript error.
2
Answers
Uncaught ReferenceError: $ is not defined
is issued because you don’t loadjquery
before another.js
files.Try to add below ( simple solution ) line into the very top of the
<head>
tag in yourlayout/theme.liquid
Be sure the version you’re calling in the scripts/vendor.js matches your jQuery version number in the scripts/vendor folder.
For example after a fresh install of slate in my vendor.js it was:
and in my vendor folder the version supplied was 3.3.1 so I changed my vendor.js to