Closed derekstavis closed 1 year ago
Do you have a code sample for this? What version of TS are you on? The line number you have doesn't line up with 4.8.2.
yarn why typescript
yarn why v1.22.19
[1/4] π€ Why do we have the module "typescript"...?
[2/4] π Initialising dependency graph...
[3/4] π Finding dependency...
[4/4] π‘ Calculating file sizes...
=> Found "typescript@4.8.2"
info Has been hoisted to "typescript"
info This module exists because it's specified in "devDependencies".
info Disk size without dependencies: "66.29MB"
info Disk size with unique dependencies: "66.29MB"
info Disk size with transitive dependencies: "66.29MB"
info Number of shared dependencies: 0
which tsc
/Users/derek/Workspace/***/node_modules/.bin/tsc
I don't have a code sample since this is just running tsc
at the repo's root. Let me know what would be the most useful information, glad to provide you!
Agh, I got the line numbers wrong. The code in question is:
Can you run tsc --listFiles
and see if there are any files in your project that are pure JS?
Unfortunately the error happens as well when --listFiles
is used:
> tsc --listFiles
/Users/derek/Workspace/***/node_modules/typescript/lib/tsc.js:98394
throw e;
^
Error: Debug Failure.
at walk (/Users/derek/Workspace/***/node_modules/typescript/lib/tsc.js:98559:38)
....
Is this repo accessible anywhere for testing? It's fine if the "code sample" is the whole repo, it's just hard to diagnose this without anything to go on.
I am having the same exact issue. Tried with 4.7.4 and 4.8.3
/Users/****/node_modules/typescript/lib/tsc.js:98438
throw e;
^
Error: Debug Failure.
at walk (/Users/****/node_modules/typescript/lib/tsc.js:98603:38)
at Object.forEachChildRecursively (/Users/****/node_modules/typescript/lib/tsc.js:25491:27)
at /Users/****/node_modules/typescript/lib/tsc.js:98519:20
at runWithCancellationToken (/Users/****/node_modules/typescript/lib/tsc.js:98432:24)
at getJSSyntacticDiagnosticsForFile (/Users/****/node_modules/typescript/lib/tsc.js:98516:20)
at getSyntacticDiagnosticsForFile (/Users/****/node_modules/typescript/lib/tsc.js:98424:65)
at /Users/****/node_modules/typescript/lib/tsc.js:98383:24
at Object.flatMap (/Users/****/node_modules/typescript/lib/tsc.js:428:25)
at getDiagnosticsHelper (/Users/****/node_modules/typescript/lib/tsc.js:98379:56)
at Object.getSyntacticDiagnostics (/Users/****/node_modules/typescript/lib/tsc.js:98387:20)
Also tried to listFiles etc, I am getting the same issue
Removing "extends": "expo/tsconfig.base"
will get rid of the issue, but it introduces other problems and wasn't the case before.
After a bit further digging, turning allowJs from true to false made the issue go away, but its not a fix though
Yes, definitely, but what I need is to find that file.
@jakebailey any other idea how I could help you to find the issue?
If you can't provide the repo, the only thing I can suggest would be to try and exclude JS files until the offending one is found and it no longer crashes.
Removing the extends
and putting allowJs: false
also made the crash go away for me. I don't have any JS files on my project, so I'm assuming that it's coming from somewhere else:
tsc --listFiles
However, this error now is coming up in the beginning. I don't have any directories with this name on my project.
error TS2688: Cannot find type definition file for 'build'.
The file is in the program because:
Entry point for implicit type library 'build'
error TS2688: Cannot find type definition file for 'examples'.
The file is in the program because:
Entry point for implicit type library 'examples'
error TS2688: Cannot find type definition file for 'lib'.
The file is in the program because:
Entry point for implicit type library 'lib'
error TS2688: Cannot find type definition file for 'node-addon-api'.
The file is in the program because:
Entry point for implicit type library 'node-addon-api'
error TS2688: Cannot find type definition file for 'test'.
The file is in the program because:
Entry point for implicit type library 'test'
allowJs
allows JS files to be loaded, and this debug assertion can only appear in a JS file, so one's getting loaded somehow.
Are there any .js files with any of those names in the error message?
For me the problem was coming from the js files in ./dist/bundles folder that was generated after running eas update
, so I just excluded them "exclude": ["./dist"]
.
If you are able to identify a specific piece of code, that would be great. Even though it's definitely a configuration error to not ignore an output directory like dist
, we shouldn't be crashing either.
I believe the problem is that we have .js files, but after switching to the hermes engine they contain bytecode instead of javascript. If I switch back to the jsc engine it will bundle to javascript and won't get the error.
.js
files that don't contain JS? That seems like a bad idea, but I don't think we should crash with them in any case.
Bug Report
Running
tsc
causes an error message:π Search Terms
Debug failure
π Version & Regression Information
π» Code
π Actual behavior
Running
tsc
gives aDebug failure
error.π Expected behavior
Running
tsc
should have worked without an error