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

Not recognizing multiple sourcemaps in the same chunk #13

Closed
frankieyan opened this issue Jun 26, 2018 · 4 comments
Closed

Not recognizing multiple sourcemaps in the same chunk #13

frankieyan opened this issue Jun 26, 2018 · 4 comments

Comments

@frankieyan
Copy link

Hi, I'm running into an issue similar to #6 . My app has a single chunk: [ 'main.css', 'main.js', 'main.css.map', 'main.js.map' ]. For each chunk, chunkToSourceMapDescriptor will only find and select the first .map pair it finds, causing the css sourcemap to be the only one to be uploaded.

I'm on Webpack 4.8.3 and webpack-bugsnag-plugins 1.2.1. I'm using mini-css-extract-plugin to extract my css - any help would be appreciated, thanks!

@bengourley
Copy link
Contributor

Hey @frankieyan thanks for reporting this. Would you be able to provide more info?

It would be absolutely amazing if you could provide a webpack.config.js and some example files that would reliably reproduce this.

Let me know what you can share, or strip out from your project, and I'll be able to help. Cheers!

@frankieyan
Copy link
Author

Hey @bengourley - you can check out this repo: https://github.com/frankieyan/bugsnag-upload-repro It emits both main.css and main.js in a single chunk. To handle this I believe chunkToSourceMapDescriptor will need walk through a chunk and anticipate multiple files.

Let me know if you need more info - I wouldn't mind taking a crack at the fix too if it helps move things forward 👍

bengourley added a commit that referenced this issue Jun 26, 2018
Certain webpack plugins, such as "mini-css-extract-plugin", cause webpack to generate multiple
output files per chunk and therefore multiple map files per chunk. The previous logic assumed there
would only be one .map file per chunk and this commit addresses that incorrect assumption.

Fixes #13.
@bengourley
Copy link
Contributor

Thanks for the repro repo, so helpful 🌟.

I've (hopefully) fixed this in #14 – I've published a prerelease to npm as v1.2.2-0. Do you want to install that and let me know that it fixes your problem?

If it works for you I also just need to route it through our qa procedure, then I can get a stable release out. Cheers!

@frankieyan
Copy link
Author

Just tested and it works great. Thanks for the quick turnaround @bengourley !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants