Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with webpack v4.29.0 and futureEmitAssets #28

Closed
chendo opened this Issue Mar 7, 2019 · 2 comments

Comments

Projects
None yet
2 participants
@chendo
Copy link

chendo commented Mar 7, 2019

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: honeybadger-io/honeybadger-webpack#85, thredup/rollbar-sourcemap-webpack-plugin#61

@chendo chendo changed the title Broken when using with webpack v4.29.0 Issue webpack v4.29.0 and futureEmitAssets Mar 7, 2019

@chendo chendo changed the title Issue webpack v4.29.0 and futureEmitAssets Issue with webpack v4.29.0 and futureEmitAssets Mar 7, 2019

@bengourley

This comment has been minimized.

Copy link
Member

bengourley commented Mar 8, 2019

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 webpack/webpack#8883 to see if we can get any help from webpack on where to take this.

bengourley added a commit that referenced this issue Mar 13, 2019

fix: Calculate paths on disk manually
Previously we relied on "existsAt" which is removed from Webpack 4.29.x (when
output.futureEmitAssets is enabled) and will be gone in 5.x by default. Calculates the paths using
apis that exist from Webpack 3 through to 5.

Fixes #28
@bengourley

This comment has been minimized.

Copy link
Member

bengourley commented Mar 13, 2019

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.