You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When setting env.target.node to "current" swc errors with:
thread '<unnamed>' panicked at /Users/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/preset_env_base-0.5.1/src/query.rs:116:46:
internal error: entered unreachable code
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
failed to handle: internal error: entered unreachable code
Failed to compile 1 file with swc.
The "current" keyword actually works and resolves the correct node version.
Documentation indicates the actual expected values for object version of env.targets. Even more important if you end deciding not to support the "current" keyword.
Errors are human readable and provide more information as to what went wrong and which config messed things up.
Actual behavior
SWC throws an "unreachable code" error and crashes.
The error:
thread '<unnamed>' panicked at /Users/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/preset_env_base-0.5.1/src/query.rs:116:46:
internal error: entered unreachable code
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
failed to handle: internal error: entered unreachable code
Failed to compile 1 file with swc.
Version
1.7.11
Additional context
No response
The text was updated successfully, but these errors were encountered:
Describe the bug
When setting
env.target.node
to"current"
swc errors with:While babel supports the
"current"
keyword.Looks like SWC only supports semver.
While babel handles the "current" keyword.
Also, it would be nicer if a better more user friendly error would be returned to the user.
Something like
Also, would be nice to modify the documentation to reflect what values the targets as object in swc are expected to be
Input code
Config
Playground link (or link to the minimal reproduction)
https://play.swc.rs/?version=1.7.11&code=H4sIAAAAAAAAAwMAAAAAAAAAAAA%3D&config=H4sIAAAAAAAAA1WOSw6DMAxE95wi8pp1F71DDxEFg4LIR3ZSNULcvSEQCDt7Zvw8aycEzKzgLdY85sVLYqRrzwonG%2BQvK4DKSFakfYC%2BujPv1igXxiJthwOLc4zVOTWjrR5Ty1bOeELmZ3CPSjst%2BCR3Jx2MG2Ixz84heSz9%2BAV3qD67wKD5Uy8DxUND%2B21AkiYM3Da0bihsFYnQBrirdNsfZbqRJz4BAAA%3D
SWC Info output
Expected behavior
Any or all of these.
"current"
keyword actually works and resolves the correct node version.env.targets
. Even more important if you end deciding not to support the"current"
keyword.Actual behavior
SWC throws an "unreachable code" error and crashes.
The error:
Version
1.7.11
Additional context
No response
The text was updated successfully, but these errors were encountered: