Avoid dynamic import when it's not needed #14192
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This fixes #14186. It's the annoying segfault; the one that affects Babel/Webpack/Jest but V8 doesn't fix. In #14110 I added a workaround just for Jest, but since it also affects other projects this PR replaces the Jest workaround with another one. It will still crash in some cases, but only when using the
--experimental-import-meta-resolve
experimental flag with Jest or Webpack (hopefully no one relies on this combination, but otherwise there is not much that we can do other than 👍 the Node.js issue and the V8 bug).@jlowcs Could you also try replacing line 26 of https://unpkg.com/browse/@babel/core@7.16.10/lib/config/files/import-meta-resolve.js with the following code, trigger a few CI runs, and see if it still works (it's a better fix from the one I already asked you to verify, because it doesn't affect the current Babel behavior other than avoiding crashes):