Comments (7)
@mhamann you should be able to attach a debugger using the instructions here https://github.com/Microsoft/TypeScript/wiki/Debugging-Language-Service-in-VS-Code
I'd add a conditional break here:
if (current.escapedName !== InternalSymbolName.Default && current.escapedName !== InternalSymbolName.ExportEquals) {
const final = cb(current.name);
if (final) return final;
}
if (chain.length > 10000) debugger; // <--- ADD
chain = append(chain, current);
current = current.flags & SymbolFlags.Alias ? checker.getImmediateAliasedSymbol(current) : undefined;
and see what's going on. The info in the locals in that function should give you a pretty good idea of what's going on. It looks like there's a thing we wrongly believe to be an alias of itself, but that construction should be impossible. It should be possible to make a minimal repro using only the relevant declarations from your code
from typescript.
Are you able to share a project which demonstrates this issue?
from typescript.
Invalid array length
RangeError: Invalid array length
at Array.push ()
at append
This stack would indicate an array hitting the 4 billion element cap... 😨
from typescript.
@mjbvz unfortunately, I can't share the project directly. it's proprietary code. happy to hop on a screen share or run specific commands if that would help.
@RyanCavanaugh i'm wondering if there's a looping issue somewhere here, because there's no way this project is that big.
from typescript.
We see this error in the Chrome DevTools code base. We use the bundled tsserver in node_modules/typescript/lib
which is 5.5.3.
Instructions for getting the source: https://chromium.googlesource.com/devtools/devtools-frontend/+/main/docs/get_the_code.md#standalone-checkout-checking-out-source
No building required, just open the checkout with any IDE that uses either the bundled tsserver or some 5.5 version for LSP.
from typescript.
Unfortunately I don't have concrete repro steps to trigger the RangeError
. It happened a couple of times while working in NamesResolver.ts
(specifically while working on this CL https://crrev.com/c/5718090).
The relevant part of the log:
Err 10497 [10:19:48.042] Exception on executing command {
"seq": 1388,
"type": "request",
"command": "getCodeFixes",
"arguments": {
"file": "<path>/devtools/devtools-frontend/front_end/models/source_map_scopes/NamesResolver.ts",
"startLine": 642,
"startOffset": 17,
"endLine": 642,
"endOffset": 27,
"errorCodes": [
2304
],
"startPosition": 24760,
"endPosition": 24770
}
}:
Invalid array length
RangeError: Invalid array length
at Array.push (<anonymous>)
at append (<path>/devtools/devtools-frontend/node_modules/typescript/lib/typescript.js:2976:6)
at forEachNameOfDefaultExport (<path>/devtools/devtools-frontend/node_modules/typescript/lib/typescript.js:138688:13)
at <path>/devtools/devtools-frontend/node_modules/typescript/lib/typescript.js:155182:115
at <path>/devtools/devtools-frontend/node_modules/typescript/lib/typescript.js:138534:119
at forEachExternalModule (<path>/devtools/devtools-frontend/node_modules/typescript/lib/typescript.js:138594:7)
at forEachExternalModuleToImportFrom (<path>/devtools/devtools-frontend/node_modules/typescript/lib/typescript.js:138534:3)
at getExportInfos (<path>/devtools/devtools-frontend/node_modules/typescript/lib/typescript.js:155177:3)
at <path>/devtools/devtools-frontend/node_modules/typescript/lib/typescript.js:155113:24
at flatMap (<path>/devtools/devtools-frontend/node_modules/typescript/lib/typescript.js:2629:17)
at getFixesInfoForNonUMDImport (<path>/devtools/devtools-frontend/node_modules/typescript/lib/typescript.js:155107:10)
at getFixInfos (<path>/devtools/devtools-frontend/node_modules/typescript/lib/typescript.js:154943:12)
at Object.getCodeActions (<path>/devtools/devtools-frontend/node_modules/typescript/lib/typescript.js:154086:18)
at <path>/devtools/devtools-frontend/node_modules/typescript/lib/typescript.js:151145:46
at flatMap (<path>/devtools/devtools-frontend/node_modules/typescript/lib/typescript.js:2629:17)
at Object.getFixes (<path>/devtools/devtools-frontend/node_modules/typescript/lib/typescript.js:151145:10)
at <path>/devtools/devtools-frontend/node_modules/typescript/lib/typescript.js:149425:33
at flatMap (<path>/devtools/devtools-frontend/node_modules/typescript/lib/typescript.js:2629:17)
at Object.getCodeFixesAtPosition (<path>/devtools/devtools-frontend/node_modules/typescript/lib/typescript.js:149423:12)
at IpcIOSession.getCodeFixes (<path>/devtools/devtools-frontend/node_modules/typescript/lib/typescript.js:191090:50)
at getCodeFixes (<path>/devtools/devtools-frontend/node_modules/typescript/lib/typescript.js:189174:43)
at <path>/devtools/devtools-frontend/node_modules/typescript/lib/typescript.js:191397:69
at IpcIOSession.executeWithRequestId (<path>/devtools/devtools-frontend/node_modules/typescript/lib/typescript.js:191389:14)
at IpcIOSession.executeCommand (<path>/devtools/devtools-frontend/node_modules/typescript/lib/typescript.js:191397:29)
at IpcIOSession.onMessage (<path>/devtools/devtools-frontend/node_modules/typescript/lib/typescript.js:191439:51)
at process.<anonymous> (<path>/devtools/devtools-frontend/node_modules/typescript/lib/tsserver.js:523:14)
at process.emit (node:events:514:28)
at emit (node:internal/child_process:937:14)
at process.processTicksAndRejections (node:internal/process/task_queues:83:21)
from typescript.
This looks like it could be the same bug: #59201
The latest VS Code - Insiders build seems to be working for me...
from typescript.
Related Issues (20)
- Mixin types are intersections rather than proper subclasses
- Duplicate keys do not error HOT 7
- JsDoc is missing/duplicated in declarations for overloads declared in classes declared in functions
- Allow excess properties in assignment if they were used in a `satisfies` check HOT 3
- Interface merging behaves inconsistently with respect to exports HOT 5
- `'X' only refers to a type` error in JSDoc comments HOT 1
- Hovering @param comments duplicates the comment in the hover HOT 3
- Design Meeting Notes, 7/23/2024
- verbatimModuleSyntax does not respect "exclude" option in tsconfig HOT 2
- Nonsensical error when creating a mixin with a type parameter HOT 2
- Web TS Server tries watching for files outside of project root HOT 1
- No completions for type parameters in generic function return type HOT 1
- Code generated by Webpack shows error in `exports` parameters in module lambdas as if they were a conflicting global `exports` HOT 3
- Debug Failure. Expected 55 <= 54 HOT 2
- Don't allow math operations on different branded numeric types HOT 2
- tsconfig.json option to ignore error TS2307 (or any specific error) HOT 5
- A strange behavior when checking `extends ReadonlyArray<any>` HOT 6
- Unique type HOT 4
- Design Meeting Notes, 7/26/2024
- Change quick fix JSDoc Import
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from typescript.