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

[Bug]: throw error when use typescript5.6 #4637

Open
beliefgp opened this issue Nov 19, 2024 · 0 comments
Open

[Bug]: throw error when use typescript5.6 #4637

beliefgp opened this issue Nov 19, 2024 · 0 comments

Comments

@beliefgp
Copy link

beliefgp commented Nov 19, 2024

Version

29.2.5

Steps to reproduce

npx jest

/** @type {import('ts-jest').JestConfigWithTsJest} **/
module.exports = {
  preset: 'ts-jest',
  testEnvironment: 'node',
  testMatch: ['**/*.test.[jt]s?(x)'],
  testPathIgnorePatterns: ['\\\\node_modules\\\\'],
  transform: {
    '^.+.tsx?$': [
      'ts-jest',
      {
        tsconfig: './tsconfig.base.json',
      },
    ],
  },
  collectCoverage: false,
  testTimeout: 60000,
};

tsconfig

{
  "compilerOptions": {
    "target": "es2020",
    "module": "esnext",
    "moduleResolution": "node",
    "declaration": true,
    "esModuleInterop": true,
    "noUnusedLocals": true,
    "noUnusedParameters": true,
    "strict": true,
    "skipLibCheck": true,
    "preserveSymlinks": false,
    "allowSyntheticDefaultImports": true,
    "jsx": "preserve",
    "verbatimModuleSyntax": true
    // "preserveValueImports": true
  },
  "exclude": ["**/node_modules", "**/examples", "**/dist", "**/fixtures", "**/*.e2e.ts", "**/templates"]
}

Expected behavior

can run

Actual behavior

Cannot read properties of undefined (reading 'sourceFile')

Debug log

Test suite failed to run

TypeError: Cannot read properties of undefined (reading 'sourceFile')

  at isDocumentRegistryEntry (node_modules/.pnpm/[email protected]/node_modules/typescript/lib/typescript.js:140899:18)
  at getDocumentRegistryEntry (node_modules/.pnpm/[email protected]/node_modules/typescript/lib/typescript.js:140975:19)
  at Object.releaseDocumentWithKey (node_modules/.pnpm/[email protected]/node_modules/typescript/lib/typescript.js:141070:19)
  at releaseOldSourceFile (node_modules/.pnpm/[email protected]/node_modules/typescript/lib/typescript.js:149911:24)
  at Object.onReleaseOldSourceFile (node_modules/.pnpm/[email protected]/node_modules/typescript/lib/typescript.js:149915:7)
  at createProgram (node_modules/.pnpm/[email protected]/node_modules/typescript/lib/typescript.js:124974:14)
  at synchronizeHostDataWorker (node_modules/.pnpm/[email protected]/node_modules/typescript/lib/typescript.js:149871:15)
  at synchronizeHostData (node_modules/.pnpm/[email protected]/node_modules/typescript/lib/typescript.js:149767:7)
  at Object.getEmitOutput (node_modules/.pnpm/[email protected]/node_modules/typescript/lib/typescript.js:150327:5)

Additional context

No response

Environment

System:
    OS: macOS 14.5
    CPU: (8) arm64 Apple M3
  Binaries:
    Node: 16.20.2
    npm: 8.19.4
    pnpm: 8.15.9
  npmPackages:
    jest: ^29.7.0 => 29.7.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant