Repository navigation
TS Server fatal error: Debug Failure. Invalid cast. The supplied value [object Object] did not pass the test 'isBindableStaticAccessExpression'. #37633
Copy link
Copy link
Closed
Labels
Needs More InfoThe issue still hasn't been fully clarifiedThe issue still hasn't been fully clarifiedVS Code PriorityCritical issues that VS Code needs fixed in the current TypeScript milestoneCritical issues that VS Code needs fixed in the current TypeScript milestone
Milestone
Description
Issue Type: Bug
TypeScript Version: 3.8.3
Steps to reproduce crash
1.
2.
3.
TS Server Error Stack
Error: Debug Failure. Invalid cast. The supplied value [object Object] did not pass the test 'isBindableStaticAccessExpression'.
at Object.cast (tsserver.js:1371:25)
at bindSpecialPropertyAssignment (tsserver.js:32562:53)
at bindWorker (tsserver.js:32114:29)
at bind (tsserver.js:31991:13)
at bindExpressionStatement (tsserver.js:31065:13)
at bindChildrenWorker (tsserver.js:30566:21)
at bindChildren (tsserver.js:30487:17)
at bind (tsserver.js:32002:21)
at tsserver.js:30493:94
at bindEach (tsserver.js:30509:21)
at bindEachFunctionsFirst (tsserver.js:30493:13)
at bindChildrenWorker (tsserver.js:30609:21)
at bindChildren (tsserver.js:30487:17)
at bind (tsserver.js:32002:21)
at visitNode (tsserver.js:18281:24)
at Object.forEachChild (tsserver.js:18411:21)
at bindEachChild (tsserver.js:30517:16)
at bindChildrenWorker (tsserver.js:30612:21)
at bindChildren (tsserver.js:30487:17)
at bindContainer (tsserver.js:30433:17)
at bind (tsserver.js:32005:21)
at visitNode (tsserver.js:18281:24)
at Object.forEachChild (tsserver.js:18484:24)
at bindEachChild (tsserver.js:30517:16)
at bindChildrenWorker (tsserver.js:30612:21)
at bindChildren (tsserver.js:30487:17)
at bind (tsserver.js:32002:21)
at bindEach (tsserver.js:30509:21)
at visitNodes (tsserver.js:18286:24)
at Object.forEachChild (tsserver.js:18474:21)
at bindEachChild (tsserver.js:30517:16)
at bindCallExpressionFlow (tsserver.js:31437:21)
at bindChildrenWorker (tsserver.js:30594:21)
at bindChildren (tsserver.js:30487:17)
at bind (tsserver.js:32002:21)
at doWithConditionalBranches (tsserver.js:30801:13)
at bindCondition (tsserver.js:30806:13)
at bindLogicalExpression (tsserver.js:31141:13)
at bindBinaryExpressionFlow (tsserver.js:31219:33)
at bindChildrenWorker (tsserver.js:30578:21)
at bindChildren (tsserver.js:30487:17)
at bind (tsserver.js:32002:21)
at bindExpressionStatement (tsserver.js:31065:13)
at bindChildrenWorker (tsserver.js:30566:21)
at bindChildren (tsserver.js:30487:17)
at bind (tsserver.js:32002:21)
at tsserver.js:30493:94
at bindEach (tsserver.js:30509:21)
at bindEachFunctionsFirst (tsserver.js:30493:13)
at bindChildrenWorker (tsserver.js:30609:21)
at bindChildren (tsserver.js:30487:17)
at bind (tsserver.js:32002:21)
at visitNode (tsserver.js:18281:24)
at Object.forEachChild (tsserver.js:18411:21)
at bindEachChild (tsserver.js:30517:16)
at bindChildrenWorker (tsserver.js:30612:21)
at bindChildren (tsserver.js:30487:17)
at bindContainer (tsserver.js:30433:17)
at bind (tsserver.js:32005:21)
at visitNode (tsserver.js:18281:24)
at Object.forEachChild (tsserver.js:18484:24)
at bindEachChild (tsserver.js:30517:16)
at bindChildrenWorker (tsserver.js:30612:21)
at bindChildren (tsserver.js:30487:17)
at bind (tsserver.js:32002:21)
at visitNode (tsserver.js:18281:24)
at Object.forEachChild (tsserver.js:18375:21)
at bindEachChild (tsserver.js:30517:16)
at bindVariableDeclarationFlow (tsserver.js:31341:13)
at bindChildrenWorker (tsserver.js:30587:21)
at bindChildren (tsserver.js:30487:17)
at bind (tsserver.js:32002:21)
at bindEach (tsserver.js:30509:21)
at visitNodes (tsserver.js:18286:24)
at Object.forEachChild (tsserver.js:18530:24)
at bindEachChild (tsserver.js:30517:16)
at bindChildrenWorker (tsserver.js:30612:21)
at bindChildren (tsserver.js:30487:17)
at bind (tsserver.js:32002:21)
at visitNode (tsserver.js:18281:24)
at Object.forEachChild (tsserver.js:18528:21)
at bindEachChild (tsserver.js:30517:16)
at bindChildrenWorker (tsserver.js:30612:21)
at bindChildren (tsserver.js:30487:17)
at bind (tsserver.js:32002:21)
at tsserver.js:30493:94
at bindEach (tsserver.js:30509:21)
at bindEachFunctionsFirst (tsserver.js:30493:13)
at bindChildrenWorker (tsserver.js:30609:21)
at bindChildren (tsserver.js:30487:17)
at bind (tsserver.js:32002:21)
at visitNode (tsserver.js:18281:24)
at Object.forEachChild (tsserver.js:18411:21)
at bindEachChild (tsserver.js:30517:16)
at bindChildrenWorker (tsserver.js:30612:21)
at bindChildren (tsserver.js:30487:17)
at bindContainer (tsserver.js:30433:17)
at bind (tsserver.js:32005:21)
at visitNode (tsserver.js:18281:24)
at Object.forEachChild (tsserver.js:18484:24)
VS Code version: Code 1.43.2 (0ba0ca52957102ca3527cf479571617f0de6ed50, 2020-03-24T07:38:38.248Z)
OS version: Windows_NT x64 10.0.18363
System Info
| Item | Value |
|---|---|
| CPUs | Intel(R) Core(TM) i3-4160 CPU @ 3.60GHz (4 x 3592) |
| GPU Status | 2d_canvas: enabled flash_3d: enabled flash_stage3d: enabled flash_stage3d_baseline: enabled gpu_compositing: enabled multiple_raster_threads: enabled_on oop_rasterization: disabled_off protected_video_decode: unavailable_off rasterization: enabled skia_renderer: disabled_off_ok video_decode: enabled viz_display_compositor: enabled_on viz_hit_test_surface_layer: disabled_off_ok webgl: enabled webgl2: enabled |
| Load (avg) | undefined |
| Memory (System) | 11.92GB (6.30GB free) |
| Process Argv | E:\Projects\dianping\pkg_1112452836_161.wxapkg_dir\app-service.js |
| Screen Reader | no |
| VM | 0% |
Extensions (26)
| Extension | Author (truncated) | Version |
|---|---|---|
| markdown-preview-github-styles | bie | 0.1.6 |
| smali | cra | 1.0.1 |
| arm | dan | 1.2.0 |
| xml | Dot | 2.5.0 |
| vscode-great-icons | emm | 2.1.47 |
| shell-format | fox | 7.0.1 |
| beautify | Hoo | 1.5.0 |
| markdown-extended | jeb | 1.0.16 |
| csharpfixformat | Leo | 0.0.84 |
| expand-region | let | 0.1.4 |
| markdown-formatter | mer | 0.7.9 |
| xml-format | mik | 1.0.2 |
| vscode-language-pack-zh-hans | MS- | 1.44.0 |
| csharp | ms- | 1.21.15 |
| python | ms- | 2020.3.69010 |
| cpptools | ms- | 0.26.3 |
| syncing | non | 3.0.13 |
| java | red | 0.58.0 |
| vscode-xml | red | 0.11.0 |
| vscodeintellicode | Vis | 1.2.6 |
| vscode-java-debug | vsc | 0.25.1 |
| vscode-java-dependency | vsc | 0.9.0 |
| vscode-java-pack | vsc | 0.8.1 |
| vscode-java-test | vsc | 0.22.2 |
| vscode-maven | vsc | 0.21.2 |
| clang-format | xav | 1.9.0 |
(2 theme extensions excluded)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Needs More InfoThe issue still hasn't been fully clarifiedThe issue still hasn't been fully clarifiedVS Code PriorityCritical issues that VS Code needs fixed in the current TypeScript milestoneCritical issues that VS Code needs fixed in the current TypeScript milestone
Activity
mjbvz commentedon Mar 27, 2020
Seems like the same error+stack mentioned in #34672
RyanCavanaugh commentedon Mar 27, 2020
Nathan Shively-Sanders (@sandersn) the referenced bug above claims to have been fixed. Maybe you can try to synthesize a repro for this?
DanielRosenwasser commentedon Apr 29, 2020
guuze (@guuzeing) can you try out the nightly extension to validate that this is fixed?
sandersn commentedon Apr 29, 2020
Ryan Cavanaugh (@RyanCavanaugh) it wasn't necessarily fixed, the repro we had just stopped crashing before we narrowed down the cause. It happened quite a while before this bug was filed, so I don't think they're the same.
sandersn commentedon Apr 29, 2020
guuze (@guuzeing), if you find that this isn't fixed, let me know and I can walk you through modifying your tsc.js to print the actual source text instead of
[object Object]. That will make reproing this easier.sandersn commentedon Apr 30, 2020
In #34672, looks like we missed the fact that
getAssignmentDeclarationKindusesisBindableStaticNameExpression, but the assertion is forisBindableStaticAccessExpression, which has some additional restrictions.I'm trying to figure out if those restrictions are proved elsewhere in
getAssignmentDeclarationKind, but if they aren't, I should be able to use that to construct a repro.sandersn commentedon Apr 30, 2020
After comparing
isBindableStaticNameExpressionwithisBindableStaticAccessExpression, I think they're equivalent, or thatisBindableStaticNameExpressionis a superset ofisBindableStaticAccessExpression. However, there are lots of possible exceptions since the functions are confusingly interdependent.In the meantime, I'm going to fix the assert message to include the declaration text at fault.
RyanCavanaugh commentedon May 20, 2020
I'm going to close this as "fixed to the best of our knowledge". Without a repro, there's no way of knowing it isn't caused by something else or was handled by one of the referenced PRs.
mohamedaymenkarmous commentedon Jul 2, 2020
Hi,
I have Angular5 project and when I tried to upgrade it to Angular9, I found this issue when I tried to execute
ng serveafter the upgrade:And it was annoying since I wasn't able to make it disappear with Typescript 3.9 nor with Typescript 3.83 and since I'm sure the project was working fine with an older version of Typescript, I tried to downgrade the version of Typescript between 3.6 and 3.9 as recommended and this issue was fixed when I downgraded Typescript from 3.8 to 3.6. But I tried to test if the version 3.7 (3.7.5) will also keep doing the job or not and I found that it did very well
This is the output of
npm outdated --allow-dirtyafter I fixed the issue:Now when I tried to deploy again the project in a new folder, I get surprised with this issue again after executing
ng serve. And then, I figured out maybe that this issue was fixed after downgrading Typescript to the version 3.6 directly and not with the version 3.7So I wanted to check if this is correct by executing:
And the error was gone
This is the output of the new
npm outdated --allow-dirty:Maybe the installation of Typescript 3.6 comes with specific dependencies that fixed the issue and those dependencies were still there even after upgrading Typescript to 3.7. I can't figure out what are these dependencies that makes this issue disappear since the only difference that we can figure out in the output of
npm outdated --allow-dirtyis the Typescript versionSo this is how I fixed this issue and I wanted to share this with you.
I hope this could be helpful
DanielRosenwasser commentedon Jul 2, 2020
Do you get the exact same stack trace in 3.9.6? Nathan Shively-Sanders (@sandersn) did some work to improve the message.