Shopify / slate

Slate is a toolkit for developing Shopify themes. It's designed to assist your workflow and speed up the process of developing, testing, and deploying themes.
https://shopify.github.io/slate
MIT License
1.28k stars 365 forks source link

"yarn start" not compliling. #885

Open jhemini opened 5 years ago

jhemini commented 5 years ago

When I entered the command "yarn" accidentally, it broke my whole build.

jhemini commented 5 years ago

./scripts/templates/gift_card.js Module build failed (from /Users/RanuelPanganiban/.nvm/versions/node/v8.12.0/lib/node_modules/@shopify/slate-tools/node_modules/babel-loader/lib/index.js): ReferenceError: Unknown plugin "transform-async-to-generator" specified in "/Users/RanuelPanganiban/Documents/jhem-work/shopify/anytimefitness-shopify/.babelrc" at 0, attempted to resolve relative to "/Users/RanuelPanganiban/Documents/jhem-work/shopify/anytimefitness-shopify" at /Users/RanuelPanganiban/.nvm/versions/node/v8.12.0/lib/node_modules/@shopify/slate-tools/node_modules/babel-core/lib/transformation/file/options/option-manager.js:180:17 at Array.map () at Function.normalisePlugins (/Users/RanuelPanganiban/.nvm/versions/node/v8.12.0/lib/node_modules/@shopify/slate-tools/node_modules/babel-core/lib/transformation/file/options/option-manager.js:158:20) at OptionManager.mergeOptions (/Users/RanuelPanganiban/.nvm/versions/node/v8.12.0/lib/node_modules/@shopify/slate-tools/node_modules/babel-core/lib/transformation/file/options/option-manager.js:234:36) at OptionManager.init (/Users/RanuelPanganiban/.nvm/versions/node/v8.12.0/lib/node_modules/@shopify/slate-tools/node_modules/babel-core/lib/transformation/file/options/option-manager.js:368:12) at File.initOptions (/Users/RanuelPanganiban/.nvm/versions/node/v8.12.0/lib/node_modules/@shopify/slate-tools/node_modules/babel-core/lib/transformation/file/index.js:212:65) at new File (/Users/RanuelPanganiban/.nvm/versions/node/v8.12.0/lib/node_modules/@shopify/slate-tools/node_modules/babel-core/lib/transformation/file/index.js:135:24) at Pipeline.transform (/Users/RanuelPanganiban/.nvm/versions/node/v8.12.0/lib/node_modules/@shopify/slate-tools/node_modules/babel-core/lib/transformation/pipeline.js:46:16)

jhemini commented 5 years ago

Failed to compile.

./scripts/layout/theme.js Module build failed (from /Users/RanuelPanganiban/.nvm/versions/node/v8.13.0/lib/node_modules/@shopify/slate-tools/node_modules/babel-loader/lib/index.js): ReferenceError: Unknown plugin "transform-async-to-generator" specified in "/Users/RanuelPanganiban/Documents/jhem-work/shopify/anytimefitness-shopify/.babelrc" at 0, attempted to resolve relative to "/Users/RanuelPanganiban/Documents/jhem-work/shopify/anytimefitness-shopify" at /Users/RanuelPanganiban/.nvm/versions/node/v8.13.0/lib/node_modules/@shopify/slate-tools/node_modules/babel-core/lib/transformation/file/options/option-manager.js:180:17 at Array.map () at Function.normalisePlugins (/Users/RanuelPanganiban/.nvm/versions/node/v8.13.0/lib/node_modules/@shopify/slate-tools/node_modules/babel-core/lib/transformation/file/options/option-manager.js:158:20) at OptionManager.mergeOptions (/Users/RanuelPanganiban/.nvm/versions/node/v8.13.0/lib/node_modules/@shopify/slate-tools/node_modules/babel-core/lib/transformation/file/options/option-manager.js:234:36) at OptionManager.init (/Users/RanuelPanganiban/.nvm/versions/node/v8.13.0/lib/node_modules/@shopify/slate-tools/node_modules/babel-core/lib/transformation/file/options/option-manager.js:368:12) at File.initOptions (/Users/RanuelPanganiban/.nvm/versions/node/v8.13.0/lib/node_modules/@shopify/slate-tools/node_modules/babel-core/lib/transformation/file/index.js:212:65) at new File (/Users/RanuelPanganiban/.nvm/versions/node/v8.13.0/lib/node_modules/@shopify/slate-tools/node_modules/babel-core/lib/transformation/file/index.js:135:24) at Pipeline.transform (/Users/RanuelPanganiban/.nvm/versions/node/v8.13.0/lib/node_modules/@shopify/slate-tools/node_modules/babel-core/lib/transformation/pipeline.js:46:16) at transpile (/Users/RanuelPanganiban/.nvm/versions/node/v8.13.0/lib/node_modules/@shopify/slate-tools/node_modules/babel-loader/lib/index.js:50:20) at Object.module.exports (/Users/RanuelPanganiban/.nvm/versions/node/v8.13.0/lib/node_modules/@shopify/slate-tools/node_modules/babel-loader/lib/index.js:173:20) @ multi /Users/RanuelPanganiban/.nvm/versions/node/v8.13.0/lib/node_modules/@shopify/slate-tools/tools/webpack/hot-client.js ./scripts/layout/theme.js layout.theme[1]

Still getting errors even in using node 8.13

jhemini commented 5 years ago

done all of the feedbacks/suggestions on this issue #425 .. it is the closest scenario in my case.. but still fail @t-kelly

huguestennier commented 5 years ago

Having a hard time reproducing this. Can you tell me the version of @shopify/slate-tools inside your package.json?

jhemini commented 5 years ago

Having a hard time reproducing this. Can you tell me the version of @shopify/slate-tools inside your package.json?

version: 1.0.0-beta.8

but whenever I check the version from terminal theres an error like this: jeremiah$ slate -v fs.js:904 return binding.readdir(pathModule._makeLong(path), options.encoding); ^

Error: ENOENT: no such file or directory, scandir '/Users/jeremiah/ElephantRoom/Shopify/allure-shopify/node_modules/@shopify/slate-tools/lib/commands' at fs.readdirSync (fs.js:904:18) at Object. (/Users/jeremiah/.nvm/versions/node/v8.12.0/lib/node_modules/@shopify/slate/lib/index.js:93:23) at Module._compile (module.js:653:30) at Object.Module._extensions..js (module.js:664:10) at Module.load (module.js:566:32) at tryModuleLoad (module.js:506:12) at Function.Module._load (module.js:498:3) at Function.Module.runMain (module.js:694:10) at startup (bootstrap_node.js:204:16) at bootstrap_node.js:625:3

jhemini commented 5 years ago

The issue is fixed if I copy the old node_modules that I have from a previous shopify slate theme.. but whenever I clone a new one.. and do "yarn install" and "yarn start" it won't extract the whole dependencies and will fail to compile..

t-kelly commented 5 years ago

@jhemini please update to the latest version of Slate, v1.0.0-beta.14.

RustyDev commented 5 years ago

I'm having the same issue. It seems to be coming from updating babel-preset-shopify:

babel-preset-shopify latest 16.6.0 ❯ 17.0.1 https://github.com/Shopify/babel-preset-shopify

That updates Babel to 7 and then that throws off the transform-async-to-generator plugin. The new version is named @babel/plugin-transform-async-to-generator and requires Babel 7.

oVertoneTy commented 5 years ago

This issue is blocking our project as well. Updated to @babel/core for jest and enzyme testing. Got this error when trying to run tests. We got around it by installing "babel-jest": "^23.6.0".

Now tests compile but these errors show when trying to yarn build. Haven't found a solution that works yet.

warning "@shopify/slate-tools > babel-loader@7.1.4" has incorrect peer dependency "babel-core@6".

oVertoneTy commented 5 years ago

Got a fix for this.

In the package.json file, add a resolutions section and add "babel-core": "7.0.0-bridge.0". This will force all sub-dependencies that include babel-core the old way to default to the bridge package and allow your 7+ @babel/core include to be the one used

jhemini commented 5 years ago

Got a fix for this.

In the package.json file, add a resolutions section and add "babel-core": "7.0.0-bridge.0". This will force all sub-dependencies that include babel-core the old way to default to the bridge package and allow your 7+ @babel/core include to be the one used

Will Try this if it will work on my end. It's getting hard to share the projects repo because of the issue. Whenever a new computer pulls the repo containing the slate folder.. npm install doesn't proceed and doesn't produce the complete dependencies

oVertoneTy commented 5 years ago

Agreed, this bug was a huge headache.

We're using yarn on our project, I do not believe npm has the same resolutions functionality out of the box. You can try installing npm-force-resolutions to get this to work with npm, though I haven't tested that package.

bigskillet commented 4 years ago

This issue still exists for me on @shopify/slate-tools": "1.0.0-beta.19.

Got a fix for this.

In the package.json file, add a resolutions section and add "babel-core": "7.0.0-bridge.0". This will force all sub-dependencies that include babel-core the old way to default to the bridge package and allow your 7+ @babel/core include to be the one used

@oVertoneTy, I tried your fix using resolutions. It looks like it resolves the original error with transform-async-to-generator, but now it can't find babel-plugin-transform-async-to-generator, looking for @babel/transform-async-to-generator.