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

fix: Chunks is not iterable when using source maps with ProfilingPlugin #6788

Merged
merged 3 commits into from
Mar 20, 2018

Conversation

byzyk
Copy link
Member

@byzyk byzyk commented Mar 18, 2018

What kind of change does this PR introduce?

bugfix

Did you add tests for your changes?

yes, for configCases

If relevant, link to documentation update:
N/A

Summary

Fixes #6779

Does this PR introduce a breaking change?

no

Other information

@byzyk
Copy link
Member Author

byzyk commented Mar 18, 2018

The problem is that in SourceMapDevToolPlugin when used with ProfilingPlugin, chunks are being passed instead of context inside compilation.hooks.afterOptimizeChunkAssets.tap callback for some reason. So the context = chunks, chunks = undefined, thus throws not iterable.

I tried to fix it by defaulting chunks to context when no context is specified but it feels like a dirty fix to me and something for sure is not working smoothly. Any thoughts on this?

cc @sokra @TheLarkInn

@sokra
Copy link
Member

sokra commented Mar 18, 2018

That looks like a bug in webpack/tapable...

@webpack-bot
Copy link
Contributor

Thank you for your pull request! The most important CI builds succeeded, we’ll review the pull request soon.

@sokra
Copy link
Member

sokra commented Mar 18, 2018

Could you add a test?

@byzyk
Copy link
Member Author

byzyk commented Mar 18, 2018

@sokra added a test case for configCases/source-map. Passing well with my dirty hack but I still haven't figured out why it happens.

@sokra sokra merged commit 3024078 into webpack:master Mar 20, 2018
@sokra
Copy link
Member

sokra commented Mar 20, 2018

Thanks for the test case.

I removed your hack and fixed the bug, which was in the implementation of the ProfilingPlugin. I was not a bug in tapable.

This was referenced Mar 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Chunks is not iterable when using source maps with ProfilingPlugin
3 participants