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

Fail to parse import attributes in TSTypeAlias #9377

Open
EliLichtblau opened this issue Aug 4, 2024 · 0 comments
Open

Fail to parse import attributes in TSTypeAlias #9377

EliLichtblau opened this issue Aug 4, 2024 · 0 comments
Labels
Milestone

Comments

@EliLichtblau
Copy link

Describe the bug

Parse failure on assert in importType

Oxc had the same bug

Input code

type Vite =  typeof import("vite", { assert: { "resolution-mode": "import" } });

Config

{
  "jsc": {
    "transform": {
        "legacyDecorator": true,
        "decoratorMetadata": true,
        "react": {
          // runtime: "automatic", // or classic
          "runtime": "automatic", //
          "throwIfNamespace": true,
          "useBuiltins": true,
          "development": false,
        },
      },
      "loose": false,
      "parser": {
        "syntax": "typescript",
        "tsx": true
      },
      "target": "es2020",
  },
  "module": {
    "type": "commonjs"
  },
  "isModule": true
}

Playground link (or link to the minimal reproduction)

https://play.swc.rs/?version=1.7.5&code=H4sIAAAAAAAAAyupLEhVCMssSVWwVVAoAXLy0xQycwvyi0o0lMqAwko6CtUKicXFqUUlVkCWUlFqcX5OaUlmfp5ubn5KqpKVghJEuZJCrUKtpjUA6VCkqlAAAAA%3D&config=H4sIAAAAAAAAA22RwW7CMAyG73uKyGckEEeOE5cd2DtYqQtBSVzZzkaFePc1Fe3Kupvj%2F7P927m%2FOQdX9XBw9yEcHiaYtWVJc2pMRzqj74%2FkWdBYBtGk0OYXaCbpRIYNGq4RIfT20ta57dZJyRYSHRxgMU5owcOmCizOR1QNflEATxxW%2FBKyi%2FD3R%2FuJibRDTyszA1OU3kuIFrL%2BJzf0RZG7RLl6bjHqQn9M4RxAZFb6S0KHoiSvt9Q%2BG97qAtZ3pF5CZ7C4k%2BntaWg1xFDOVP0A6X63341lowyJmxJp8ZFD7wp6TonzVWEmg54mdhzy%2BAHqvjFtBgIAAA%3D%3D

SWC Info output

No response

Expected behavior

Should compile

Actual behavior

Fails to compile

Version

1.7.6

Additional context

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants