I have an app that worked just fine. Somehow, after upgrading modules through yarn, Heroku started crashing when precompiling assets. I can reproduce the error locally when running rails assets:precompile, on the fly compiling works though. I'm more of a backend dev and have tried to debug this without success for days, any help would be very much apprechated.
Stylesheets are under app/javascript/stylesheets and for some plugins in node_modules.
Referenced fonts & images in stylesheets app/javascript/images and for some plugins in node_modules.
This is the error I'm getting after updating things through yarn:
rails assets:precompile
yarn install v1.22.17
[1/4] 🔍 Resolving packages...
success Already up-to-date.
✨ Done in 0.56s.
Compiling...
Compilation failed:
Hash: 1b22a2a5da6a4c5eaaea
Version: webpack 4.46.0
Time: 11875ms
Built at: 10/31/2021 6:59:18 PM
24 assets
Entrypoint application = js/application-a0f426d4f3221843ac92.js js/application-a0f426d4f3221843ac92.js.map
[110] (webpack)/buildin/module.js 552 bytes {0} [built]
[111] ./app/javascript/images/01.jpeg 99 bytes {0} [optional] [built]
[112] ./app/javascript/images/application/chevron-right-solid.svg 127 bytes {0} [optional] [built]
[113] ./app/javascript/images/application/logo.png 112 bytes {0} [optional] [built]
[114] ./app/javascript/images/application/spinner.gif 115 bytes {0} [optional] [built]
[115] ./app/javascript/images/homepage/slider/herz_feuer.jpg 122 bytes {0} [optional] [built]
[116] ./app/javascript/images/homepage/slider/simon_rosenberger.jpg 129 bytes {0} [optional] [built]
[122] multi ./app/javascript/packs/application.js ./app/javascript/packs/application.scss 40 bytes {0} [built]
[123] ./app/javascript/packs/application.js 1010 bytes {0} [built]
[160] ./app/javascript/channels/index.js 205 bytes {0} [built]
[162] ./app/javascript/images sync ^\.\/.*$ 523 bytes {0} [built]
[183] ./app/javascript/scripts/theme.js 20.5 KiB {0} [built]
[184] ./app/javascript/scripts/theme_extension.js 382 bytes {0} [built]
[185] ./app/javascript/packs/application.scss 714 bytes {0} [built]
[186] ./node_modules/css-loader/dist/cjs.js??ref--6-1!./node_modules/postcss-loader/src??ref--6-2!./node_modules/resolve-url-loader!./node_modules/sass-loader/dist/cjs.js??ref--6-4!./app/javascript/packs/application.scss 2.25 KiB {0} [built] [failed] [1 error]
+ 175 hidden modules
ERROR in ./app/javascript/packs/application.scss (./node_modules/css-loader/dist/cjs.js??ref--6-1!./node_modules/postcss-loader/src??ref--6-2!./node_modules/resolve-url-loader!./node_modules/sass-loader/dist/cjs.js??ref--6-4!./app/javascript/packs/application.scss)
Module build failed (from ./node_modules/postcss-loader/src/index.js):
ParserError: Syntax Error at line: 1, column 25
at /Users/user/Development/novoglobo/app/javascript/packs/application.scss:11:8157
at Parser.error (/Users/user/Development/novoglobo/node_modules/postcss-values-parser/lib/parser.js:127:11)
at Parser.operator (/Users/user/Development/novoglobo/node_modules/postcss-values-parser/lib/parser.js:162:20)
at Parser.parseTokens (/Users/user/Development/novoglobo/node_modules/postcss-values-parser/lib/parser.js:245:14)
at Parser.loop (/Users/user/Development/novoglobo/node_modules/postcss-values-parser/lib/parser.js:132:12)
at Parser.parse (/Users/user/Development/novoglobo/node_modules/postcss-values-parser/lib/parser.js:51:17)
at parse (/Users/user/Development/novoglobo/node_modules/postcss-custom-properties/index.cjs.js:47:30)
at /Users/user/Development/novoglobo/node_modules/postcss-custom-properties/index.cjs.js:333:24
at /Users/user/Development/novoglobo/node_modules/postcss/lib/container.js:194:18
at /Users/user/Development/novoglobo/node_modules/postcss/lib/container.js:139:18
at Rule.each (/Users/user/Development/novoglobo/node_modules/postcss/lib/container.js:105:16)
at Rule.walk (/Users/user/Development/novoglobo/node_modules/postcss/lib/container.js:135:17)
at /Users/user/Development/novoglobo/node_modules/postcss/lib/container.js:152:24
at Root.each (/Users/user/Development/novoglobo/node_modules/postcss/lib/container.js:105:16)
at Root.walk (/Users/user/Development/novoglobo/node_modules/postcss/lib/container.js:135:17)
at Root.walkDecls (/Users/user/Development/novoglobo/node_modules/postcss/lib/container.js:192:19)
at transformProperties (/Users/user/Development/novoglobo/node_modules/postcss-custom-properties/index.cjs.js:330:8)
at Object.syncTransform [as plugin] (/Users/user/Development/novoglobo/node_modules/postcss-custom-properties/index.cjs.js:522:5)
at /Users/user/Development/novoglobo/node_modules/postcss-preset-env/index.js:443:97
@ ./app/javascript/packs/application.scss 2:26-278
@ multi ./app/javascript/packs/application.js ./app/javascript/packs/application.scss
I have an app that worked just fine. Somehow, after upgrading modules through yarn, Heroku started crashing when precompiling assets. I can reproduce the error locally when running
rails assets:precompile
, on the fly compiling works though. I'm more of a backend dev and have tried to debug this without success for days, any help would be very much apprechated.Here's the code I have:
package.json
environment.js
webpack.config.js
Stylesheets are under
app/javascript/stylesheets
and for some plugins in node_modules. Referenced fonts & images in stylesheetsapp/javascript/images
and for some plugins in node_modules.This is the error I'm getting after updating things through yarn: