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: typescript example fails test: Exception during run: Error: Debug Failure. #105

Open
4 tasks done
JoshuaKGoldberg opened this issue Jan 7, 2025 · 0 comments
Open
4 tasks done
Labels
type: bug Something isn't working

Comments

@JoshuaKGoldberg
Copy link
Member

Bug Report Checklist

  • I have read and agree to Mocha's Code of Conduct and Contributing Guidelines
  • I have searched for related issues and issues with the faq label, but none matched my issue.
  • I have 'smoke tested' the code to be tested by running it outside the real test suite to get a better sense of whether the problem is in the code under test, my usage of Mocha, or Mocha itself.
  • I want to provide a PR to resolve this

Expected

npm run test in packages/typescript should pass.

Actual

joshgoldberg ~/repos/mocha-examples/packages/typescript $ npm run test

> [email protected] test
> mocha


 Exception during run: Error: Debug Failure. False expression: Non-string value passed to `ts.resolveTypeReferenceDirective`, likely by a wrapping package working with an outdated `resolveTypeReferenceDirectives` signature. This is probably not a problem in TS itself.
    at Object.resolveTypeReferenceDirective (/Users/josh/repos/mocha-examples/packages/typescript/node_modules/typescript/lib/typescript.js:43500:18)
    at /Users/josh/repos/mocha-examples/packages/typescript/node_modules/ts-node/src/index.ts:623:55
    at Array.map (<anonymous>)
    at Object.resolveTypeReferenceDirectives (/Users/josh/repos/mocha-examples/packages/typescript/node_modules/ts-node/src/index.ts:622:33)
    at actualResolveTypeReferenceDirectiveNamesWorker (/Users/josh/repos/mocha-examples/packages/typescript/node_modules/typescript/lib/typescript.js:119382:163)
    at resolveTypeReferenceDirectiveNamesWorker (/Users/josh/repos/mocha-examples/packages/typescript/node_modules/typescript/lib/typescript.js:119682:26)
    at processTypeReferenceDirectives (/Users/josh/repos/mocha-examples/packages/typescript/node_modules/typescript/lib/typescript.js:121185:31)
    at findSourceFileWorker (/Users/josh/repos/mocha-examples/packages/typescript/node_modules/typescript/lib/typescript.js:121070:21)
    at findSourceFile (/Users/josh/repos/mocha-examples/packages/typescript/node_modules/typescript/lib/typescript.js:120922:26)
    at processImportedModules (/Users/josh/repos/mocha-examples/packages/typescript/node_modules/typescript/lib/typescript.js:121331:25)
    at findSourceFileWorker (/Users/josh/repos/mocha-examples/packages/typescript/node_modules/typescript/lib/typescript.js:121076:17)
    at findSourceFile (/Users/josh/repos/mocha-examples/packages/typescript/node_modules/typescript/lib/typescript.js:120922:26)
    at processImportedModules (/Users/josh/repos/mocha-examples/packages/typescript/node_modules/typescript/lib/typescript.js:121331:25)
    at findSourceFileWorker (/Users/josh/repos/mocha-examples/packages/typescript/node_modules/typescript/lib/typescript.js:121076:17)
    at findSourceFile (/Users/josh/repos/mocha-examples/packages/typescript/node_modules/typescript/lib/typescript.js:120922:26)
    at processImportedModules (/Users/josh/repos/mocha-examples/packages/typescript/node_modules/typescript/lib/typescript.js:121331:25)
    at findSourceFileWorker (/Users/josh/repos/mocha-examples/packages/typescript/node_modules/typescript/lib/typescript.js:121076:17)
    at findSourceFile (/Users/josh/repos/mocha-examples/packages/typescript/node_modules/typescript/lib/typescript.js:120922:26)
    at /Users/josh/repos/mocha-examples/packages/typescript/node_modules/typescript/lib/typescript.js:120871:85
    at getSourceFileFromReferenceWorker (/Users/josh/repos/mocha-examples/packages/typescript/node_modules/typescript/lib/typescript.js:120837:34)
    at processSourceFile (/Users/josh/repos/mocha-examples/packages/typescript/node_modules/typescript/lib/typescript.js:120871:13)
    at /Users/josh/repos/mocha-examples/packages/typescript/node_modules/typescript/lib/typescript.js:121175:17
    at Object.forEach (/Users/josh/repos/mocha-examples/packages/typescript/node_modules/typescript/lib/typescript.js:181:30)
    at processReferencedFiles (/Users/josh/repos/mocha-examples/packages/typescript/node_modules/typescript/lib/typescript.js:121174:16)
    at findSourceFileWorker (/Users/josh/repos/mocha-examples/packages/typescript/node_modules/typescript/lib/typescript.js:121069:21)
    at findSourceFile (/Users/josh/repos/mocha-examples/packages/typescript/node_modules/typescript/lib/typescript.js:120922:26)
    at /Users/josh/repos/mocha-examples/packages/typescript/node_modules/typescript/lib/typescript.js:120871:85
    at getSourceFileFromReferenceWorker (/Users/josh/repos/mocha-examples/packages/typescript/node_modules/typescript/lib/typescript.js:120837:34)
    at processSourceFile (/Users/josh/repos/mocha-examples/packages/typescript/node_modules/typescript/lib/typescript.js:120871:13)
    at processTypeReferenceDirectiveWorker (/Users/josh/repos/mocha-examples/packages/typescript/node_modules/typescript/lib/typescript.js:121216:21)
    at processTypeReferenceDirective (/Users/josh/repos/mocha-examples/packages/typescript/node_modules/typescript/lib/typescript.js:121201:13)
    at Object.createProgram (/Users/josh/repos/mocha-examples/packages/typescript/node_modules/typescript/lib/typescript.js:119485:21)
    at synchronizeHostData (/Users/josh/repos/mocha-examples/packages/typescript/node_modules/typescript/lib/typescript.js:169335:26)
    at Object.getProgram (/Users/josh/repos/mocha-examples/packages/typescript/node_modules/typescript/lib/typescript.js:169449:13)
    at getOutput (/Users/josh/repos/mocha-examples/packages/typescript/node_modules/ts-node/src/index.ts:731:39)
    at Object.compile (/Users/josh/repos/mocha-examples/packages/typescript/node_modules/ts-node/src/index.ts:968:32)
    at Module.m._compile (/Users/josh/repos/mocha-examples/packages/typescript/node_modules/ts-node/src/index.ts:1056:42)
    at Module._extensions..js (node:internal/modules/cjs/loader:1548:10)
    at Object.require.extensions.<computed> [as .ts] (/Users/josh/repos/mocha-examples/packages/typescript/node_modules/ts-node/src/index.ts:1059:12)
    at Module.load (node:internal/modules/cjs/loader:1288:32)
    at Function.Module._load (node:internal/modules/cjs/loader:1104:12)
    at Module.require (node:internal/modules/cjs/loader:1311:19)
    at require (node:internal/modules/helpers:179:18)
    at Object.exports.requireOrImport (/Users/josh/repos/mocha-examples/packages/typescript/node_modules/mocha/lib/nodejs/esm-utils.js:53:16)
    at Object.exports.loadFilesAsync (/Users/josh/repos/mocha-examples/packages/typescript/node_modules/mocha/lib/nodejs/esm-utils.js:100:20)
    at singleRun (/Users/josh/repos/mocha-examples/packages/typescript/node_modules/mocha/lib/cli/run-helpers.js:162:3)
    at Object.exports.handler (/Users/josh/repos/mocha-examples/packages/typescript/node_modules/mocha/lib/cli/run.js:375:5)
joshgoldberg ~/repos/mocha-examples/packages/typescript $ 

Minimal, Reproducible Example

npm i
cd packages/typescript
npm run compile
npm run test

Versions

Mocha is current latest, 11.0.1.

Reproduces on Node 20.18.0 and 23.5.0 that I've tried.

Additional Info

No response

@JoshuaKGoldberg JoshuaKGoldberg added the type: bug Something isn't working label Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant