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

Deno run panic & deno lsp server crash when processing this code #11898

Closed
zxch3n opened this issue Sep 2, 2021 · 3 comments
Closed

Deno run panic & deno lsp server crash when processing this code #11898

zxch3n opened this issue Sep 2, 2021 · 3 comments
Labels
bug Something isn't working correctly fix available there is a fix available in a third party library that needs to be merged swc related to swc (bundling/transpiling)

Comments

@zxch3n
Copy link

zxch3n commented Sep 2, 2021

function imp<T extends string>(x: T): typeof import(T) {
    return x;
}

console.log("123");

Error

thread 'main' panicked at 'internal error: entered unreachable code: parse_lit should not be called', /Users/lucacasonato/.cargo/registry/src/github.com-1ecc6299db9ec823/swc_ecma_parser-0.66.2/src/parser/expr.rs:1574:18
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Version

deno 1.13.2 (release, aarch64-apple-darwin)
v8 9.3.345.11
typescript 4.3.5
@kitsonk kitsonk added swc related to swc (bundling/transpiling) bug Something isn't working correctly labels Sep 2, 2021
@kitsonk
Copy link
Contributor

kitsonk commented Sep 2, 2021

That isn't valid TypeScript (import(_) requires a string literal), but it shouldn't panic.

@kitsonk kitsonk added the fix available there is a fix available in a third party library that needs to be merged label Sep 9, 2021
@kitsonk
Copy link
Contributor

kitsonk commented Sep 9, 2021

This has been fixed upstream, and should be included in Deno 1.14.

@dsherret
Copy link
Member

Seems fixed now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working correctly fix available there is a fix available in a third party library that needs to be merged swc related to swc (bundling/transpiling)
Projects
None yet
Development

No branches or pull requests

3 participants