Skip to content

Syntax error after updating to 1.6.8 #734

Description

@0x241F31

After upgrading from 1.6.7 to 1.6.8, I get following error:

[api] 
[api] node:internal/process/esm_loader:48
[api]       internalBinding('errors').triggerUncaughtException(
[api]                                 ^
[api] [Error: 
[api]   x Expected ',', got '{'
[api]    ,-[file:///home/foxpro/craft/sferadel/dev/api/main.mts:2:1]
[api]  2 | import * as path from "node:path"
[api]  3 | import { availableParallelism } from "node:os"
[api]  4 | import * as fs from "node:fs/promises"
[api]  5 | import type { Worker } from "node:cluster"
[api]    :             ^
[api]  6 | import cluster from "node:cluster"
[api]  7 | import { match } from "ts-pattern"
[api]  8 | import { createYoga } from "graphql-yoga"
[api]    `----
[api] 
[api] 
[api] Caused by:
[api]     Syntax Error] {
[api]   code: 'GenericFailure'
[api] }
[api] 
[api] Node.js v20.6.1
[api] [[Command exited with 1]]

My .swcrc:

{
  "$schema": "https://json.schemastore.org/swcrc",
  "jsc": {
    "baseUrl": ".",
    "parser": {
      "syntax": "typescript"
    },
    "target": "esnext",
    "loose": true,
    "paths": {
      "#/*": ["./*"],
      "#eql": ["./eql/index.mts"],
      "#eql/types": ["./eql/types.d.ts"]
    }
  },
  "module": {
    "type": "es6"
  }
}
My tsconfig.json
{
  "compilerOptions": {
    "strict": false,
    "strictNullChecks": true,
    "strictFunctionTypes": true,

    "baseUrl": ".",
    // "sourceMap": true, // mandatory for SWC
    "target": "ESNext",
    "module": "NodeNext",
    "moduleResolution": "NodeNext",
    // "resolvePackageJsonImports": true,
    // https://github.com/swc-project/swc-node/pull/723
    "paths": {
      "#/*": ["./*"],
      "#eql": ["./eql/index.mts"],
      "#eql/types": ["./eql/types.d.ts"]
    },

    "noEmit": true,
    "isolatedModules": true,

    "skipDefaultLibCheck": true,
    "skipLibCheck": true
  },
  "exclude": ["**/node_modules", "**/.*/"]
}

I tried with "@swc/core": "^1.3.86" and "@swc/core": "^1.3.90", no difference.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions