swc-project / swc

Rust-based platform for the Web
https://swc.rs
Apache License 2.0
31.23k stars 1.23k forks source link

Cannot build project after updating @swc/core to 1.7.28 #9592

Closed kishieel closed 1 month ago

kishieel commented 1 month ago

Describe the bug

'RuntimeError: unreachable' or 'Command failed with signal "SIGILL"' when building project with new version of core (1.7.28)

Input code

export type SafeResult<T> = { data: T; error: undefined } | { data: undefined; error: any };

export const safe = <T>(fn: () => T): SafeResult<T> => {
    try {
        const data = fn();
        return { data, error: undefined };
    } catch (error) {
        return { data: undefined, error };
    }
};

Config

{
    "$schema": "https://swc.rs/schema.json",
    "sourceMaps": true,
    "jsc": {
      "parser": {
        "syntax": "typescript",
        "decorators": true,
        "dynamicImport": true,
        "dts": true,
        "tsx": false
      },
      "target": "es5",
      "baseUrl": "./",
      "preserveAllComments": false,
      "experimental": {
        "emitIsolatedDts": true
      },
      "paths": {
        "@lib/*": ["src/*"],
        "@tests/*": ["tests/*"]
      },
      "loose": false
    },
    "module": {
        "type": "commonjs",
        "strict": true,
        "strictMode": true,
        "lazy": false,
        "noInterop": false
    },
    "minify": false,
    "isModule": true
}

Playground link (or link to the minimal reproduction)

https://play.swc.rs/?version=1.7.28&code=H4sIAAAAAAAAA23OUQqDMAwG4Pee4n9sYSdop4fYvEDRlA1GlBph4nr31SnFjeUpNH%2B%2FhJ5DHwUyD4SrD3ShcXrIualRYUHnxVs0DhRjHy0m7ijcmTokvMq8vJac5xnJKUWb3vY8CsbMZzXbOrCFNqhqNMb%2B7q2xKOSSOO%2FdWpuxLsxGYG1cGUWSKfJ%2BzunPrVs0ofXS3qA%2FAXOwv4DDz90qgEruDVTAL8MwAQAA&config=H4sIAAAAAAAAA21RsW4CMQzd%2BxUo6lRV3NSFiapdGBg7VQwmZ0pQEke2abki%2Fr3J3UE5uEzJe%2Fbze87xYZKPeRS7xQBmNjFb1SSzqpIfO2WpOmK6E4rmuSsW2rPFJSTJ9cp77PGd2Awc20d%2BJmBBvkJKaxMVDmWMNgnFskvay7Z8jZYYlHgo3XFNhODsIiRiHaF1pEelDNuAF%2BzB05k1CvyFRcigvFxMmDUIfrAv%2BLT6hxNjTvONr96%2FUQgY23Gt8qUGDwnZFQ78MDcGpwshD4r1%2B8XonaUEupVh59y7dfWUsU8jbPNtdRVvrigqPX2%2Br%2B5kPZHgYA89ZwLVe4%2FDieVnSnqbY1LcyfX%2FiLKzI8vv8CXVeM95%2BG1uV5XhSIuoyJTGjbnoNjdtxsny7Ldd3%2BkPw3cEHb4CAAA%3D

SWC Info output

Operating System:
    Platform: linux
    Arch: x64
    Machine Type: x86_64

Binaries:
    Node: 18.17.0
    npm: 9.6.7
    Yarn: 1.22.22
    pnpm: N/A

Relevant Packages:
    @swc/core: 1.7.28
    @swc/helpers: N/A
    @swc/types: 0.1.12
    typescript: 5.6.2

SWC Config:
    output: N/A
    .swcrc path: N/A

Next.js info:
    output: N/A

Expected behavior

It should build valid javascript files

Actual behavior

It fails with a RuntimeError: unreachable

Version

@swc/cli: 0.4.0 @swc/core: 1.7.28

Additional context

No response

kdy1 commented 1 month ago

I did npm dist-tag add @swc/core@1.7.26 latest for now.

kdy1 commented 1 month ago

Thank you for reporting!

swc-bot commented 1 week ago

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.