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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid createBundleTree if same asset #1669

Conversation

Projects
None yet
2 participants
@terrierscript
Copy link
Contributor

terrierscript commented Jul 5, 2018

Thank you for great product.
I checkout master branch, and got Maximum call stack size exceeded in master branch when below code.

window.Buffer = require("buffer/").Buffer
Server running at http://localhost:1234
馃毃  Maximum call stack size exceeded
    at Bundler.createBundleTree (/***/src/Bundler.js:583:19)
    at Bundler.createBundleTree (/***/src/Bundler.js:652:12)
    at Bundler.createBundleTree (/***/src/Bundler.js:652:12)
    at Bundler.createBundleTree (/***/src/Bundler.js:652:12)
    at Bundler.createBundleTree (/***/src/Bundler.js:652:12)
    at Bundler.createBundleTree (/***/src/Bundler.js:652:12)
    at Bundler.createBundleTree (/***/src/Bundler.js:652:12)
    at Bundler.createBundleTree (/***/src/Bundler.js:652:12)
    at Bundler.createBundleTree (/***/src/Bundler.js:652:12)
    at Bundler.createBundleTree (/***/src/Bundler.js:652:12)

If my approach is not good, please close this PR.

terrierscript added some commits Jul 5, 2018

@devongovett

This comment has been minimized.

Copy link
Member

devongovett commented Jul 7, 2018

hmm I cannot reproduce this error... is there any other code that might be causing it? can you provide a minimal test case that reproduces it?

@terrierscript

This comment has been minimized.

Copy link
Contributor Author

terrierscript commented Jul 8, 2018

I can make little project.
https://github.com/terrierscript/parcel-call-stack-bug

This bug occur when new Worker.

// index.js
const worker = new Worker("./worker.js");
// worker.js
window.Buffer = require("buffer/").Buffer;
@devongovett

This comment has been minimized.

Copy link
Member

devongovett commented Jul 9, 2018

Ah, thanks for finding this bug. It is specific to workers (or really, isolated bundles in general, where assets may be duplicated into multiple bundles). I fixed it in a slightly different way in f2deb5c, which fixes indirect circular deps as well.

@terrierscript terrierscript deleted the terrierscript:avoid-same-dependency-stack branch Jul 9, 2018

@terrierscript

This comment has been minimized.

Copy link
Contributor Author

terrierscript commented Jul 9, 2018

@devongovett
Thank you for great work!
Current master work well. I look forward to latest version!

2zH added a commit to 2zH/parcel that referenced this pull request Jul 11, 2018

devongovett added a commit that referenced this pull request Oct 15, 2018

devongovett added a commit that referenced this pull request Oct 15, 2018

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