bugsnag / webpack-bugsnag-plugins

Webpack plugins for common BugSnag actions.
MIT License
32 stars 29 forks source link

Issue with webpack v4.29.0 and futureEmitAssets #28

Closed chendo closed 5 years ago

chendo commented 5 years ago

Stacktrace:

path.js:28
    throw new TypeError('Path must be a string. Received ' + inspect(path));
    ^

TypeError: Path must be a string. Received undefined
    at assertPath (path.js:28:11)
    at extname (path.js:1471:5)
    at maps.map.map (/app/node_modules/webpack-bugsnag-plugins/source-map-uploader-plugin.js:70:52)
    at Array.map (<anonymous>)
    at chunkToSourceMapDescriptors (/app/node_modules/webpack-bugsnag-plugins/source-map-uploader-plugin.js:47:21)
    at Array.map (<anonymous>)
    at plugin (/app/node_modules/webpack-bugsnag-plugins/source-map-uploader-plugin.js:89:39)
    at AsyncSeriesHook.eval [as callAsync] (eval at create (/app/node_modules/tapable/lib/HookCodeFactory.js:32:10), <anonymous>:7:1)
    at AsyncSeriesHook.lazyCompileHook (/app/node_modules/tapable/lib/Hook.js:154:20)
    at asyncLib.forEachLimit.err (/app/node_modules/next/node_modules/webpack/lib/Compiler.js:432:27)
    at /app/node_modules/neo-async/async.js:2813:7
    at done (/app/node_modules/neo-async/async.js:3521:9)
    at outputFileSystem.writeFile.err (/app/node_modules/next/node_modules/webpack/lib/Compiler.js:400:9)
    at /app/node_modules/graceful-fs/graceful-fs.js:45:10
    at FSReqWrap.oncomplete (fs.js:135:15)

Related to output.futureEmitAssets introduced in webpack v4.29.0 which prevents plugins from accessing asset contents in afterEmit. Setting options.output.futureEmitAssets to false appears to fix this for now but is used by Next.js v8 projects.

Related: https://github.com/honeybadger-io/honeybadger-webpack/issues/85, https://github.com/thredup/rollbar-sourcemap-webpack-plugin/issues/61

bengourley commented 5 years ago

Hey @chendo, thanks for reporting this. I've had a look into it and I can't see how we can get it working again. I've opened https://github.com/webpack/webpack/issues/8883 to see if we can get any help from webpack on where to take this.

bengourley commented 5 years ago

Thanks for reporting. This should now be fixed in v1.4.0.