Closed
Description
Library Affected:
workbox-webpack-plugin
Issue or Feature Request Description:
When combining source maps with webpack and workbox I get the following error at build time.
> next build
info - Creating an optimized production build
Failed to compile.
You must provide the URL of lib/mappings.wasm by calling SourceMapConsumer.initialize({ 'lib/mappings.wasm': ... }) before using SourceMapConsumer
> Build error occurred
Error: > Build failed because of webpack errors
at /Users/DavidAdler/code/with-typescript-app/node_modules/next/dist/build/index.js:15:918
at async /Users/DavidAdler/code/with-typescript-app/node_modules/next/dist/build/tracer.js:1:525
My nextjs webpack config looks like so
const { InjectManifest } = require('workbox-webpack-plugin')
const withSourceMaps = require('@zeit/next-source-maps')
module.exports = withSourceMaps({
webpack: (config, { buildId, dev, isServer, defaultLoaders, webpack }) => {
config.plugins.push(
new InjectManifest({
swSrc: './sw.js',
})
)
return config
},
})
A minimal failing example can be found here
To recreate run npm run build
(after cloning and npm install)