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 deleting modules after link failure. Resolves #2286. #2288
Conversation
File size impactMerging issue-2286 into master will impact 3 files in 2 groups. browser (2/2)
node (1/1)
extras (0/8)No impact on files in extras group. |
Nice to see the fix. I'm still a little uncomfortable merging this without getting to the bottom of the root cause behind it. Specifically:
This makes me think perhaps the root cause is actually the tracing path not rethrowing the promise, in which case that path should become: process.env.SYSTEM_PRODUCTION && function (err) {
triggerOnLoad(...);
throw err;
} Perhaps check if something along those lines might work here? |
The reason is that Perhaps the best solution would be to wait for both the instantiate and link promises of depLoads, and have |
Thanks for the info, ok then we're still not quite there on quite understanding the logic so should keep digging a bit I think. We cannot wait on the link promise of children because of cycles though. In this algorithm, the instantiation promise is the promise for the registration of the module, wile the link promise is the promise for the resolve and instantiate of its dependencies. Let me schedule some time to properly grok this when I can. |
@joeldenning see #2289 for a fix to the onload handlers. Perhaps try running the test case here against that and see if anything changes? |
Unfortunately the test case I added here is not fixed by the code in #2289. |
daee1c1
to
a4d6eda
Compare
Managed to push up a fix for this - thanks for the clear test case and diagnosis here @joeldenning. |
Actually seems this is still your fix, still digging... |
Ok I think I finally got the logic on this - the path you found was exactly correct down to two issues: (1) I dont think it would handle deep errors since linking promises only reflect the first level, and (2) these code paths should directly align with the error tracing hook code paths. In addition fixed up some bugs on the error tracing too. Thanks gain for the exact isolation and fix on this. |
See #2286. Note that this bug only occurs if the link failure occurs in a dependency, instead of directly on the top level load.