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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RuntimeError: Unreachable code should not be executed with "export * import" #4896

Closed
jrieken opened this issue Jun 7, 2022 · 1 comment · Fixed by #4904
Closed

RuntimeError: Unreachable code should not be executed with "export * import" #4896

jrieken opened this issue Jun 7, 2022 · 1 comment · Fixed by #4904
Assignees
Labels
Milestone

Comments

@jrieken
Copy link

jrieken commented Jun 7, 2022

Describe the bug

Disabling noInterop and using export * as foo from '...' causes a runtime error.

Input code

export * as icons from 'vs/workbench/contrib/welcomeGettingStarted/browser/gettingStartedIcons';

Config

{
  "jsc": {
    "parser": {
      "syntax": "typescript",
      "tsx": false
    },
    "target": "es2021",
    "loose": false
  },
  "module": {
    "type": "amd",
    "noInterop": true
  }
}

Playground link

https://play.swc.rs/?version=1.2.197&code=H4sIAAAAAAAAA1XMMQ6AIAwAwN1XdCNx6QN8gHH2BYAViUJN24jPV0fXG47uk8WgB6%2BQI1eFVbiAuxQbyx6oxg1fN8kBGx2RC41klmuazYvRgkG4KQmmH09f5obuASkqlHRhAAAA&config=H4sIAAAAAAAAA0WMOw6EMAwF7%2BKaYqHMDfYYFjxWoBBHtpFAKHdfp6J7n9E8tNtM6aHKatCe7C7OFyXyu8Jm3arTQG4xrZwNLQrrDx4IbPpMY9xZxPAChyxnRrd1SYB8LEEV%2BRaHSqXkeqK1P3IDBQF%2FAAAA

Expected behavior

Don't crash

Actual behavior

RuntimeError: Unreachable code should not be executed (evaluating 'wasm.transformSync(retptr, ptr0, len0, addHeapObject(opts), addHeapObject(experimental_plugin_bytes_resolver))')

<?>.wasm-function[rust_panic]@[wasm code]
<?>.wasm-function[std::panicking::rust_panic_with_hook::hdd08feebb16a5d0c]@[wasm code]
<?>.wasm-function[std::panicking::begin_panic_handler::{{closure}}::hb1a3fff83235176b]@[wasm code]
<?>.wasm-function[std::sys_common::backtrace::__rust_end_short_backtrace::h35976c7c7e728385]@[wasm code]
<?>.wasm-function[rust_begin_unwind]@[wasm code]
<?>.wasm-function[core::panicking::panic_fmt::h9f028a3b92cbae68]@[wasm code]
<?>.wasm-function[<swc_ecma_transforms_module::amd::Amd as swc_ecma_visit::Fold>::fold_module::h1c3a7c7765ba7dfd]@[wasm code]
<?>.wasm-function[<swc_visit::AndThen<A,B> as swc_ecma_visit::Fold>::fold_module::h9c0c01a01e8f77a5]@[wasm code]
<?>.wasm-function[swc_ecma_visit::fold_program::h7196f616511203b5]@[wasm code]
<?>.wasm-function[swc::Compiler::process_js_file::hc1b323162f01e479]@[wasm code]
<?>.wasm-function[transformSync]@[wasm code]
wasm-stub@[native code]
transformSync@https://cdn.jsdelivr.net/npm/@swc/wasm-web@1.2.197/wasm-web.js:189:27
@https://play.swc.rs/_next/static/chunks/690.4aed1dcbbd422faa.js:1:38668
Qo@https://play.swc.rs/_next/static/chunks/framework-e75f20a0d9e1f5eb.js:1:67116
Le@https://play.swc.rs/_next/static/chunks/690.4aed1dcbbd422faa.js:1:38355
ko@https://play.swc.rs/_next/static/chunks/framework-e75f20a0d9e1f5eb.js:1:62747
Nu@https://play.swc.rs/_next/static/chunks/framework-e75f20a0d9e1f5eb.js:1:83700
ys@https://play.swc.rs/_next/static/chunks/framework-e75f20a0d9e1f5eb.js:1:109192
vs@https://play.swc.rs/_next/static/chunks/framework-e75f20a0d9e1f5eb.js:1:109120
hs@https://play.swc.rs/_next/static/chunks/framework-e75f20a0d9e1f5eb.js:1:108983
us@https://play.swc.rs/_next/static/chunks/framework-e75f20a0d9e1f5eb.js:1:106103
us@[native code]
jl@https://play.swc.rs/_next/static/chunks/framework-e75f20a0d9e1f5eb.js:1:46914
@https://play.swc.rs/_next/static/chunks/framework-e75f20a0d9e1f5eb.js:1:103700

Version

1.2.197

Additional context

Related to microsoft/vscode#150025 but not critical

@jrieken jrieken added the C-bug label Jun 7, 2022
jrieken added a commit to microsoft/vscode that referenced this issue Jun 7, 2022
@kdy1 kdy1 added this to the Planned milestone Jun 7, 2022
@kdy1 kdy1 self-assigned this Jun 8, 2022
@kdy1 kdy1 closed this as completed in #4904 Jun 8, 2022
@kdy1 kdy1 modified the milestones: Planned, v1.2.198, v1.2.199 Jun 8, 2022
@swc-bot
Copy link
Collaborator

swc-bot commented Oct 16, 2022

This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@swc-project swc-project locked as resolved and limited conversation to collaborators Oct 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

Successfully merging a pull request may close this issue.

3 participants