Error when pushing to heroku: Module build failed (from ./node_modules/postcss-loader/src/index.js), SyntaxError: Unexpected token ... #1948
-
| I received the following error when pushing my project to Heroku for the first time. remote:        Child mini-css-extract-plugin node_modules/css-loader/index.js?url=false!node_modules/postcss-loader/src/index.js!css/app.css:
remote:        Entrypoint mini-css-extract-plugin = *
remote:        [0] ./node_modules/css-loader?url=false!./node_modules/postcss-loader/src!./css/app.css 3.26 KiB {0} [built] [failed] [1 error]
remote:        
remote:        ERROR in ./css/app.css (./node_modules/css-loader?url=false!./node_modules/postcss-loader/src!./css/app.css)
remote:        Module build failed (from ./node_modules/postcss-loader/src/index.js):
remote:        /tmp/build_158b63743b815c98215b026251972bc2/assets/node_modules/tailwindcss/lib/lib/substituteVariantsAtRules.js:92
remote:        const variantGenerators = { ...defaultVariantGenerators(config),
remote:        ^^^
remote:        SyntaxError: Unexpected token ...
remote:        at NativeCompileCache._moduleCompile (/tmp/build_158b63743b815c98215b026251972bc2/assets/node_modules/v8-compile-cache/v8-compile-cache.js:240:18)
remote:        at Module._compile (/tmp/build_158b63743b815c98215b026251972bc2/assets/node_modules/v8-compile-cache/v8-compile-cache.js:186:36)Here is the assets folder in my elixir/phoenix project: https://github.com/axelclark/ex338/tree/design/assets. Any ideas what the issue could be? | 
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
| I would start by doing a fresh install locally: 
 If the project still runs in your machine, try pushing it to Heroku again, without  | 
Beta Was this translation helpful? Give feedback.
-
| Sounds like Heroku is using an old version of Node that doesn’t support object spread. Try configuring Heroku to use a modern version of node, like at least v10. | 
Beta Was this translation helpful? Give feedback.
Sounds like Heroku is using an old version of Node that doesn’t support object spread. Try configuring Heroku to use a modern version of node, like at least v10.