This repository has been archived by the owner on Feb 2, 2023. It is now read-only.
fix(babel-node): fix a critical bug where missing polyfills were crashing the library #712
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.
Summary
It seems that our node transpiled version has an issue with the pinned version of @babel/node, which relied on @babel/polyfills#7.0.0 which had a bug where it did not include correctly import its core-js dependency.
To fix this, I reset the lockfile and added
@babel/polyfill
with a non bugged version to fix the issue.Result
Library does not crash when used with
import
.Next Steps
This bug has been present for a while but was not detected because we were not using polyfills until the IE11 release, and therefore we were not hitting that part of the code.
The current ways of validating the build rely on the self contained library which is not compiled through babel-node but by webpack, and uses a correct version of
@babel/polyfills
. Therefore a clear next step is to add a way to validate the babel-node build.Fixes #711