I suddenly started getting this error when deploying. It does not cancel deployment. Therefore, the application after launch does not work.
I took all the configs from the master branch: https://github.com/rails/webpacker/tree/master/lib/install/config
During application deployment, I get the following errors:
Done in 25.85s.
Compiling…
Compiled all packs in /tmp/build/public/packs
Unhandled rejection Error: original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.
at SourceMapGenerator_validateMapping [as _validateMapping] (/tmp/build/node_modules/source-map/lib/source-map-generator.js:276:15)
at SourceMapGenerator_addMapping [as addMapping] (/tmp/build/node_modules/source-map/lib/source-map-generator.js:110:12)
at /tmp/build/node_modules/source-map/lib/source-map-generator.js:72:17
at Array.forEach (<anonymous>)
at BasicSourceMapConsumer.SourceMapConsumer_eachMapping [as eachMapping] (/tmp/build/node_modules/source-map/lib/source-map-consumer.js:157:14)
at Function.SourceMapGenerator_fromSourceMap [as fromSourceMap] (/tmp/build/node_modules/source-map/lib/source-map-generator.js:48:24)
at SourceMapSource.node (/tmp/build/node_modules/webpack-sources/lib/SourceMapSource.js:32:35)
at SourceMapSource.proto.sourceAndMap (/tmp/build/node_modules/webpack-sources/lib/SourceAndMapMixin.js:30:18)
at getTaskForFile (/tmp/build/node_modules/webpack/lib/SourceMapDevToolPlugin.js:37:30)
at files.forEach (/tmp/build/node_modules/webpack/lib/SourceMapDevToolPlugin.js:136:20)
at Array.forEach (<anonymous>)
at compilation.hooks.afterOptimizeChunkAssets.tap (/tmp/build/node_modules/webpack/lib/SourceMapDevToolPlugin.js:130:12)
at SyncHook.eval [as call] (eval at create (/tmp/build/node_modules/tapable/lib/HookCodeFactory.js:19:10), <anonymous>:7:1)
at SyncHook.lazyCompileHook (/tmp/build/node_modules/tapable/lib/Hook.js:154:20)
at hooks.optimizeChunkAssets.callAsync.err (/tmp/build/node_modules/webpack/lib/Compilation.js:1315:42)
at _err1 (eval at create (/tmp/build/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:12:1)
at taskRunner.run (/tmp/build/node_modules/terser-webpack-plugin/dist/index.js:319:9)
at step (/tmp/build/node_modules/terser-webpack-plugin/dist/TaskRunner.js:87:9)
at done (/tmp/build/node_modules/terser-webpack-plugin/dist/TaskRunner.js:98:30)
at tryCatcher (/tmp/build/node_modules/bluebird/js/release/util.js:16:23)
at Promise._settlePromiseFromHandler (/tmp/build/node_modules/bluebird/js/release/promise.js:517:31)
at Promise._settlePromise (/tmp/build/node_modules/bluebird/js/release/promise.js:574:18)
at Promise._settlePromise0 (/tmp/build/node_modules/bluebird/js/release/promise.js:619:10)
at Promise._settlePromises (/tmp/build/node_modules/bluebird/js/release/promise.js:699:18)
at Promise._fulfill (/tmp/build/node_modules/bluebird/js/release/promise.js:643:18)
at Promise._resolveCallback (/tmp/build/node_modules/bluebird/js/release/promise.js:437:57)
at Promise._settlePromiseFromHandler (/tmp/build/node_modules/bluebird/js/release/promise.js:529:17)
at Promise._settlePromise (/tmp/build/node_modules/bluebird/js/release/promise.js:574:18)
at Promise._settlePromise0 (/tmp/build/node_modules/bluebird/js/release/promise.js:619:10)
at Promise._settlePromises (/tmp/build/node_modules/bluebird/js/release/promise.js:699:18)
at Promise._fulfill (/tmp/build/node_modules/bluebird/js/release/promise.js:643:18)
at Promise._resolveCallback (/tmp/build/node_modules/bluebird/js/release/promise.js:437:57)
at Promise._settlePromiseFromHandler (/tmp/build/node_modules/bluebird/js/release/promise.js:529:17)
at Promise._settlePromise (/tmp/build/node_modules/bluebird/js/release/promise.js:574:18)
at Promise._settlePromise0 (/tmp/build/node_modules/bluebird/js/release/promise.js:619:10)
at Promise._settlePromises (/tmp/build/node_modules/bluebird/js/release/promise.js:699:18)
Asset precompilation completed (79.79s)
Cleaning assets
Running: rake assets:clean
And when the application is running, I get this:
(visually):
500 Internal Server Error
If you are the administrator of this website, then please read this web application's log file and/or the web server's log file to find out what went wrong.
(in logs):
2019-06-29T20:20:46.488758312Z app[web.1]: web| F, [2019-06-29T20:20:46.488510 #17] FATAL -- : [4242ee0c-5165-4148-a252-027f143a1ebd]
2019-06-29T20:20:46.488780327Z app[web.1]: web| F, [2019-06-29T20:20:46.488560 #17] FATAL -- : [4242ee0c-5165-4148-a252-027f143a1ebd] ActionView::Template::Error (Webpacker can't find public in /app/public/packs/manifest.json. Possible causes:
2019-06-29T20:20:46.488789138Z app[web.1]: web| 1. You want to set webpacker.yml value of compile to true for your environment
2019-06-29T20:20:46.488792540Z app[web.1]: web| unless you are using the `webpack -w` or the webpack-dev-server.
2019-06-29T20:20:46.488795329Z app[web.1]: web| 2. webpack has not yet re-run to reflect updates.
2019-06-29T20:20:46.488798313Z app[web.1]: web| 3. You have misconfigured Webpacker's config/webpacker.yml file.
2019-06-29T20:20:46.488801714Z app[web.1]: web| 4. Your webpack configuration is not creating a manifest.
2019-06-29T20:20:46.488804835Z app[web.1]: web| Your manifest contains:
2019-06-29T20:20:46.488807717Z app[web.1]: web| {
2019-06-29T20:20:46.488810309Z app[web.1]: web| }
2019-06-29T20:20:46.488813262Z app[web.1]: web| ):
2019-06-29T20:20:46.489274878Z app[web.1]: web| F, [2019-06-29T20:20:46.489001 #17] FATAL -- : [4242ee0c-5165-4148-a252-027f143a1ebd] 1: / Vue.js
2019-06-29T20:20:46.489288952Z app[web.1]: web| [4242ee0c-5165-4148-a252-027f143a1ebd] 2: - unless %w[private_messages].include?(controller_name)
2019-06-29T20:20:46.489292688Z app[web.1]: web| [4242ee0c-5165-4148-a252-027f143a1ebd] 3: - content_for :vue_app_style
2019-06-29T20:20:46.489296404Z app[web.1]: web| [4242ee0c-5165-4148-a252-027f143a1ebd] 4: = stylesheet_pack_tag 'public'
2019-06-29T20:20:46.489530503Z app[web.1]: web| [4242ee0c-5165-4148-a252-027f143a1ebd] 5: - content_for :vue_app_javascript
2019-06-29T20:20:46.489537835Z app[web.1]: web| [4242ee0c-5165-4148-a252-027f143a1ebd] 6: = javascript_pack_tag 'public'
2019-06-29T20:20:46.489540795Z app[web.1]: web| [4242ee0c-5165-4148-a252-027f143a1ebd] 7:
2019-06-29T20:20:46.489543577Z app[web.1]: web| F, [2019-06-29T20:20:46.489075 #17] FATAL -- : [4242ee0c-5165-4148-a252-027f143a1ebd]
2019-06-29T20:20:46.489546508Z app[web.1]: web| F, [2019-06-29T20:20:46.489118 #17] FATAL -- : [4242ee0c-5165-4148-a252-027f143a1ebd] app/views/layouts/public/main.html.slim:4:in `block in _app_views_layouts_public_main_html_slim__4157578837778433280_431893339940'
Something happened after June 13th. I haven't updated anything since. Today I ran the bundle and yarn commands. I also followed your upgrade instructions. I had the task to update the dependencies. Therefore, I have not added any new packages. And my configs for Webpack matched your current.
But this did not fix the problem. I can not even understand what caused it...
package.json:
{
"name": "app",
"private": true,
"dependencies": {
"@fortawesome/fontawesome-free": "^5.2.0",
"@fortawesome/fontawesome-svg-core": "^1.2.7",
"@fortawesome/free-solid-svg-icons": "^5.4.2",
"@fortawesome/vue-fontawesome": "^0.1.1",
"@rails/webpacker": "^4.0.2",
"@sentry/browser": "^5.3.0",
"@sentry/integrations": "^5.3.1",
"axios": "^0.18.0",
"bootstrap": "4.3.1",
"bootstrap-vue": "^2.0.0-rc.20",
"chart.js": "^2.7.2",
"current-device": "^0.8.0",
"highcharts": "^6.1.0",
"jquery": "^3.3.1",
"lodash": "^4.17.4",
"popper.js": "^1.14.7",
"quill": "^1.3.6",
"sweet-scroll": "^4.0.0",
"v-click-outside": "^2.0.1",
"v-runtime-template": "^1.5.2",
"vue": "^2.6.10",
"vue-chartkick": "^0.3.3",
"vue-i18n": "^7.4.0",
"vue-loader": "^15.7.0",
"vue-quill-editor": "^3.0.6",
"vue-resource": "^1.5.1",
"vue-template-compiler": "^2.5.13",
"vuejs-noty": "^0.1.3",
"vuex": "^3.0.1"
},
"devDependencies": {
"webpack-dev-server": "^3.4.1"
}
}
Source yarn.lock file (good): https://pastebin.com/raw/TaSkeXV2
The yarn.lock file after yarn upgrade (problem): https://pastebin.com/raw/rpHrhCMQ
Comparison: https://www.diffchecker.com/NIdKTOBF
When pushing to Heroku I am getting this same error with a brand new rails 6 app and default configuration.
➜ my_app_test git:(master) rails -v
Rails 6.0.0.rc1
➜ my_app_test git:(master) rbenv local
2.6.2
➜ my_app_test git:(master) yarn -v
1.16.0
Here is a repo with a default rails app that the error can be reproduced with:
https://github.com/NickSchimek/default_rails_6_app
I’ll add that I use Rails 5.2.3 and Ruby 2.6.3. Locally yarn 1.16, and on the server yarn 1.17 (locally and on the server the error is the same). Dokku is responsible for the server.
Having this too :(
I was having this issue, and while testing different things I ran yarn upgrade, which updated terser from 4.0.1 to 4.0.2 and that fixed it for me.
Thank you @guzart yarn upgrade fixed it on my end too!
Actual information.
Since my last comment, some of the dependencies have been updated.
Currently, the yarn upgrade command does not crash the application.
While this is no longer happening, I think the fact that this broke the builds but did not _fail_ the builds is still an issue and should be reopened.
@mike1o1 ok, opened.
The problem is related to https://github.com/terser-js/terser/issues/380#issuecomment-507067182
I have created a PR to fix this for us: https://github.com/webpack-contrib/terser-webpack-plugin/pull/103
Most helpful comment
I was having this issue, and while testing different things I ran
yarn upgrade, which updated terser from4.0.1to4.0.2and that fixed it for me.