privatenumber / tsx

⚡️ TypeScript Execute | The easiest way to run TypeScript in Node.js
https://tsx.is
MIT License
9.77k stars 154 forks source link

Unexpected identifier assert #632

Closed vuthanhtrung2010 closed 3 months ago

vuthanhtrung2010 commented 3 months ago

Acknowledgements

Minimal reproduction URL

https://github.com/user-attachments/assets/981fe72b-adad-4ad4-b3ae-90bd0b464180

Problem & expected behavior (under 200 words)

Hi this is my tsconfig.json

{
  "compilerOptions": {
    /* Language and Environment */
    "target": "ES2022" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */,

    /* Modules */
    "module": "ES2022" /* Specify what module code is generated. */,
    "lib": ["ES2022"],
    "moduleResolution": "Node",
    "allowImportingTsExtensions": true,
    "allowJs": true,
    "rootDir": "src/",
    "baseUrl": "src/",
    "importHelpers": true,
    "esModuleInterop": true,
    "resolveJsonModule": true,
    "types": ["node", "discord.js", "discord-hybrid-sharding"],
    "allowSyntheticDefaultImports": true,

    /* Type Checking */
    "strict": true /* Enable all strict type-checking options. */,
    "noImplicitAny": true,
    "skipLibCheck": true /* Skip type checking all .d.ts files. */,

    /* Prevent Output */
    "noEmit": true /* Do not emit outputs. */
  },
  "exclude": ["eslint.config.mjs"]
}

image-42

Note the error started from my friend lib. Have assert type JSON. Well I tried to modify node_modules and it works well. that's esm import. So unexpected identifier assert in esm import? That's false. I set to type: module already in package.json

Bugs are expected to be fixed by those affected by it

Compensating engineering work will speed up resolution and support the project

privatenumber commented 3 months ago

Please read the issue template warning about reproductions