We've moved discussions to Discord

[SOLVED] Webpacker won't compile on Linux with a fresh clone of Jumpstart

Lucas Carlson
I have a brand new clone and after running bundle exec rake assets:precompile, it works on my Mac but will not compile on my Linux server in production...

~/jumpstart-pro$ RAILS_ENV=production bundle exec rake assets:precompile
yarn install v1.22.10
[1/4] Resolving packages...
[2/4] Fetching packages...
info fsevents@2.1.3: The platform "linux" is incompatible with this module.
info "fsevents@2.1.3" is an optional dependency and failed compatibility check. Excluding it from installation.
info fsevents@1.2.13: The platform "linux" is incompatible with this module.
info "fsevents@1.2.13" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
[4/4] Building fresh packages...
Done in 9.18s.
I, [2021-01-20T11:12:44.171335 #8658]  INFO -- : Writing /home/lucas/jumpstart-pro/public/assets/application-04024382391bb910584145d8113cf35ef376b55d125bb4516cebeb14ce788597.css
I, [2021-01-20T11:12:44.171904 #8658]  INFO -- : Writing /home/lucas/jumpstart-pro/public/assets/application-04024382391bb910584145d8113cf35ef376b55d125bb4516cebeb14ce788597.css.gz
I, [2021-01-20T11:12:44.172537 #8658]  INFO -- : Writing /home/lucas/jumpstart-pro/public/assets/administrate/application-291597bdd61f420b4323c8b76925b3a7342ce9d275d75e5d7a9c1b85fdfa72fa.css
I, [2021-01-20T11:12:44.172895 #8658]  INFO -- : Writing /home/lucas/jumpstart-pro/public/assets/administrate/application-291597bdd61f420b4323c8b76925b3a7342ce9d275d75e5d7a9c1b85fdfa72fa.css.gz
Compiling...
Compiled all packs in /home/lucas/jumpstart-pro/public/packs
(node:8739) UnhandledPromiseRejectionWarning: Error: "version" is a required argument.
    at Object.getArg (/home/lucas/jumpstart-pro/node_modules/source-map/lib/util.js:24:11)
    at new BasicSourceMapConsumer (/home/lucas/jumpstart-pro/node_modules/source-map/lib/source-map-consumer.js:294:22)
    at new SourceMapConsumer (/home/lucas/jumpstart-pro/node_modules/source-map/lib/source-map-consumer.js:22:7)
    at SourceMapSource.node (/home/lucas/jumpstart-pro/node_modules/webpack/node_modules/webpack-sources/lib/SourceMapSource.js:193:4)
    at exports.getSourceAndMap (/home/lucas/jumpstart-pro/node_modules/webpack/node_modules/webpack-sources/lib/helpers.js:20:27)
    at SourceMapSource.sourceAndMap (/home/lucas/jumpstart-pro/node_modules/webpack/node_modules/webpack-sources/lib/SourceMapSource.js:184:10)
    at getTaskForFile (/home/lucas/jumpstart-pro/node_modules/webpack/lib/SourceMapDevToolPlugin.js:78:30)
    at /home/lucas/jumpstart-pro/node_modules/webpack/lib/SourceMapDevToolPlugin.js:266:22
    at /home/lucas/jumpstart-pro/node_modules/webpack/lib/Cache.js:93:5
    at Hook.eval [as callAsync] (eval at create (/home/lucas/jumpstart-pro/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:6:1)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:8739) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:8739) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Lucas Carlson
For anyone else who is having this problem, see here: https://gitlab.com/gorails/jumpstart-pro/-/issues/92

Comment from Chris Oliver:

My fix was to add "devtool: false" to config/webpack/base.js (or production.js) 

A deploy with that should skip sourcemaps and fix it. It's really a bug in Webpacker 6 at the moment as it shouldn't continue running even though it clearly had an error. So much has been changing with that gem! 😅

Notifications
You’re not receiving notifications from this thread.