My production build fails when I'm using contenthash for my bundled file names.
I'm getting the following error:
Unhandled rejection Error: "." is not in the SourceMap.
at BasicSourceMapConsumer.SourceMapConsumer_sourceContentFor [as sourceContentFor] (C:\Users\USER\Documents\Projects\my-project\node_modules\source-map\lib\source-map-consumer.js:753:13)
at C:\Users\USER\Documents\Projects\my-project\node_modules\webpack-sources\lib\applySourceMap.js:88:47
at SourceNode_walk [as walk] (C:\Users\USER\Documents\Projects\my-project\node_modules\source-map\lib\source-node.js:230:9)
at SourceNode_walk [as walk] (C:\Users\USER\Documents\Projects\my-project\node_modules\source-map\lib\source-node.js:226:13)
at applySourceMap (C:\Users\USER\Documents\Projects\my-project\node_modules\webpack-sources\lib\applySourceMap.js:58:13)
at SourceMapSource.node (C:\Users\USER\Documents\Projects\my-project\node_modules\webpack-sources\lib\SourceMapSource.js:36:11)
at SourceMapSource.proto.sourceAndMap (C:\Users\USER\Documents\Projects\my-project\node_modules\webpack-sources\lib\SourceAndMapMixin.js:29:18)
at getTaskForFile (C:\Users\USER\Documents\Projects\my-project\node_modules\webpack\lib\SourceMapDevToolPlugin.js:64:30)
at files.forEach (C:\Users\USER\Documents\Projects\my-project\node_modules\webpack\lib\SourceMapDevToolPlugin.js:200:20)
at Array.forEach (<anonymous>)
at compilation.hooks.afterOptimizeChunkAssets.tap (C:\Users\USER\Documents\Projects\my-project\node_modules\webpack\lib\SourceMapDevToolPlugin.js:177:12)
at SyncHook.eval [as call] (eval at create (C:\Users\USER\Documents\Projects\my-project\node_modules\tapable\lib\HookCodeFactory.js:19:10), <anonymous>:7:1)
at SyncHook.lazyCompileHook (C:\Users\USER\Documents\Projects\my-project\node_modules\tapable\lib\Hook.js:154:20)
at hooks.optimizeChunkAssets.callAsync.err (C:\Users\USER\Documents\Projects\my-project\node_modules\webpack\lib\Compilation.js:1385:42)
at _err0 (eval at create (C:\Users\USER\Documents\Projects\my-project\node_modules\tapable\lib\HookCodeFactory.js:32:10), <anonymous>:11:1)
at taskRunner.run (C:\Users\USER\Documents\Projects\my-project\node_modules\terser-webpack-plugin\dist\index.js:321:9)
at step (C:\Users\USER\Documents\Projects\my-project\node_modules\terser-webpack-plugin\dist\TaskRunner.js:87:9)
at _cacache.default.get.then (C:\Users\USER\Documents\Projects\my-project\node_modules\terser-webpack-plugin\dist\TaskRunner.js:111:15)
at tryCatcher (C:\Users\USER\Documents\Projects\my-project\node_modules\bluebird\js\release\util.js:16:23)
at Promise._settlePromiseFromHandler (C:\Users\USER\Documents\Projects\my-project\node_modules\bluebird\js\release\promise.js:517:31)
at Promise._settlePromise (C:\Users\USER\Documents\Projects\my-project\node_modules\bluebird\js\release\promise.js:574:18)
at Promise._settlePromise0 (C:\Users\USER\Documents\Projects\my-project\node_modules\bluebird\js\release\promise.js:619:10)
at Promise._settlePromises (C:\Users\USER\Documents\Projects\my-project\node_modules\bluebird\js\release\promise.js:699:18)
at Promise._fulfill (C:\Users\USER\Documents\Projects\my-project\node_modules\bluebird\js\release\promise.js:643:18)
at Promise._resolveCallback (C:\Users\USER\Documents\Projects\my-project\node_modules\bluebird\js\release\promise.js:437:57)
at Promise._settlePromise (C:\Users\USER\Documents\Projects\my-project\node_modules\bluebird\js\release\promise.js:574:18)
at Promise._settlePromise0 (C:\Users\USER\Documents\Projects\my-project\node_modules\bluebird\js\release\promise.js:619:10)
at Promise._settlePromises (C:\Users\USER\Documents\Projects\my-project\node_modules\bluebird\js\release\promise.js:699:18)
at Promise._fulfill (C:\Users\USER\Documents\Projects\my-project\node_modules\bluebird\js\release\promise.js:643:18)
at Promise._resolveCallback (C:\Users\USER\Documents\Projects\my-project\node_modules\bluebird\js\release\promise.js:437:57)
at Promise._settlePromiseFromHandler (C:\Users\USER\Documents\Projects\my-project\node_modules\bluebird\js\release\promise.js:529:17)
at Promise._settlePromise (C:\Users\USER\Documents\Projects\my-project\node_modules\bluebird\js\release\promise.js:574:18)
at Promise._settlePromise0 (C:\Users\USER\Documents\Projects\my-project\node_modules\bluebird\js\release\promise.js:619:10)
at Promise._settlePromises (C:\Users\USER\Documents\Projects\my-project\node_modules\bluebird\js\release\promise.js:699:18)
at Promise._fulfill (C:\Users\USER\Documents\Projects\my-project\node_modules\bluebird\js\release\promise.js:643:18)
If I use [hash:5] instead of [contenthash:5] it builds without errors.
If I set devtool: 'none' instead of devtool: 'source-map', it also builds without errors.
And if I ignore the fuse.js plugin. It also builds without errors.
new webpack.IgnorePlugin(/fuse.js/), // IGNORING THE FUSE.JS PLUGIN, IT BUILDS WITHOUT ERRORS
What could be happening? Has anyone encountered some issue like this before?
Here's my problem:
My production build fails when I'm using
contenthash
for my bundled file names.I'm getting the following error:
This is my webpack config.
webpack.prod.js
package.json
If I use
[hash:5]
instead of[contenthash:5]
it builds without errors. If I setdevtool: 'none'
instead ofdevtool: 'source-map'
, it also builds without errors. And if I ignore thefuse.js
plugin. It also builds without errors.new webpack.IgnorePlugin(/fuse.js/), // IGNORING THE FUSE.JS PLUGIN, IT BUILDS WITHOUT ERRORS
What could be happening? Has anyone encountered some issue like this before?