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

Does not support modulesuffixes in tsconfig.json #2060

Open
jayshah123 opened this issue Sep 12, 2023 · 1 comment
Open

Does not support modulesuffixes in tsconfig.json #2060

jayshah123 opened this issue Sep 12, 2023 · 1 comment

Comments

@jayshah123
Copy link

Search Terms

We use https://www.typescriptlang.org/tsconfig#moduleSuffixes for react-native project.

Adding this config option causes ts-node to break, is there a way to avoid this?

Expected Behavior

ts-node should not crash

Actual Behavior

$ ts-node ./scripts/i18n/build-i18n.ts
/bitrise/src/node_modules/ts-node/src/index.ts:859
    return new TSError(diagnosticText, diagnosticCodes, diagnostics);
           ^
TSError: ⨯ Unable to compile TypeScript:
error TS5023: Unknown compiler option 'moduleSuffixes'.
    at createTSError (/bitrise/src/node_modules/ts-node/src/index.ts:859:12)
    at reportTSError (/bitrise/src/node_modules/ts-node/src/index.ts:863:19)
    at createFromPreloadedConfig (/bitrise/src/node_modules/ts-node/src/index.ts:874:36)
    at phase4 (/bitrise/src/node_modules/ts-node/src/bin.ts:543:44)
    at bootstrap (/bitrise/src/node_modules/ts-node/src/bin.ts:95:10)
    at main (/bitrise/src/node_modules/ts-node/src/bin.ts:55:10)
    at Object.<anonymous> (/bitrise/src/node_modules/ts-node/src/bin.ts:800:3)
    at Module._compile (node:internal/modules/cjs/loader:1218:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1272:10)
    at Module.load (node:internal/modules/cjs/loader:1081:32) {
  diagnosticCodes: [ 5023 ]
}

Steps to reproduce the problem

Create a project with moduleSuffixes compiler option.

Minimal reproduction

Specifications

  • ts-node version: 10.9.1
  • node version: 18.3.0
  • TypeScript version: 4.7.4
  • tsconfig.json, if you're using one:
{
  "compilerOptions": {
    "target": "esnext",
    "module": "commonjs",
    "lib": ["es6"],
    "allowJs": true,
    "jsx": "react-native",
    "noEmit": true,
    "isolatedModules": true,
    "strict": true,
    "moduleResolution": "node",
    "baseUrl": "./",
    "allowSyntheticDefaultImports": true,
    "esModuleInterop": true,
    "resolveJsonModule": true,
    "moduleSuffixes": [".ios", ".android", ".native", ""],
    "paths": {
      "@app/*": ["./app/*"],
      "@lib/*": ["./app/lib/*"],
      "@assets/*": ["./assets/*"],
      "@hooks/*": ["./app/hooks/*"],
      "@modules/*": ["./app/modules/*"],
      "@utilities/*": ["./app/utilities/*"]
    }
  },
  "exclude": [
    "./node_modules",
    "./node_modules",
    "babel.config.js",
    "metro.config.js",
    "./jest.config.js"
  ]
}

  • package.json:
{}
  • Operating system and version: 13.5.1 (22G90)
  • If Windows, are you using WSL or WSL2?: No
@cspotcode
Copy link
Collaborator

error TS5023: Unknown compiler option 'moduleSuffixes'.

That error comes from the TypeScript compiler. You can check the version of TS that ts-node is using:

ts-node -vvv

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

No branches or pull requests

2 participants