Repository navigation
Auto import in angular typescript is not working #28773
Description
Activity
Does this reproduce in the latest VS Code insiders build with all extensions disabled?
This happens with latest build both on macOS and Windows 10. A latest few builds, the autocomplete feels incosistent and partially working.
I tried restarting the app, but no good.
I haven't tried this insiders build. I am using the official final build.
Try on insiders
I've just tried insiders version on Windows 10. The problem is still there. Auto import is not picking up the definition inside installed
@datorama/akitapackage:Cannot find name 'ID'.ts(2304)It gets even weirder with
rxjspackage. Definitions fromrxjsare offered for auto import, but the ones insiderxjs/operatorslikemapTocannot be found.The conclusion is that this auto import logic is obviously broken.
I confirmed this by using TS 3.3.0-dev20181130.
The
index.d.tsfromakitahasexport * from './api/types';which has anIDtype. I see this error after trying to open theapi/typesfile directly:Err 403 [11:12:21.819] Exception on executing command {"seq":65,"type":"request","command":"getApplicableRefactors","arguments":{"file":"/Users/matb/projects/san/node_modules/@datorama/akita/src/api/types.d.ts","startLine":1,"startOffset":1,"endLine":1,"endOffset":1}}: Could not find file: '/Users/matb/projects/san/node_modules/@datorama/akita/src/api/types.d.ts'. Error: Could not find file: '/Users/matb/projects/san/node_modules/@datorama/akita/src/api/types.d.ts'. at getValidSourceFile (/Users/matb/projects/san/node_modules/typescript/lib/tsserver.js:117240:23) at Object.getApplicableRefactors (/Users/matb/projects/san/node_modules/typescript/lib/tsserver.js:118017:24) at IOSession.Session.getApplicableRefactors (/Users/matb/projects/san/node_modules/typescript/lib/tsserver.js:125638:53) at Session.handlers.ts.createMapFromTemplate._a.(anonymous function) (/Users/matb/projects/san/node_modules/typescript/lib/tsserver.js:124512:61) at /Users/matb/projects/san/node_modules/typescript/lib/tsserver.js:125857:88 at IOSession.Session.executeWithRequestId (/Users/matb/projects/san/node_modules/typescript/lib/tsserver.js:125848:28) at IOSession.Session.executeCommand (/Users/matb/projects/san/node_modules/typescript/lib/tsserver.js:125857:33) at IOSession.Session.onMessage (/Users/matb/projects/san/node_modules/typescript/lib/tsserver.js:125879:35) at Interface.<anonymous> (/Users/matb/projects/san/node_modules/typescript/lib/tsserver.js:127139:27) at emitOne (events.js:116:13) at Interface.emit (events.js:211:7) at Interface._onLine (readline.js:282:10) at Interface._normalWrite (readline.js:424:12) at Socket.ondata (readline.js:141:10) at emitOne (events.js:116:13) at Socket.emit (events.js:211:7) at addChunk (_stream_readable.js:263:12) at readableAddChunk (_stream_readable.js:250:11) at Socket.Readable.push (_stream_readable.js:208:10) at Pipe.onread (net.js:594:20)- addedBugA bug in TypeScriptA bug in TypeScriptDomain: LS: TSServerIssues related to the TSServerIssues related to the TSServerCrashFor flagging bugs which are compiler or service crashes or unclean exits, rather than bad outputFor flagging bugs which are compiler or service crashes or unclean exits, rather than bad output
on Nov 30, 2018 12 remaining items
- removedCrashFor flagging bugs which are compiler or service crashes or unclean exits, rather than bad outputFor flagging bugs which are compiler or service crashes or unclean exits, rather than bad output
on Jan 16, 2019 This is still not working, even with the latest VSCode version :(
- removedNeeds More InfoThe issue still hasn't been fully clarifiedThe issue still hasn't been fully clarified
on Mar 14, 2019 sheetalkamat commented
on Jul 18, 2019 MemberMore actionsRyan Cavanaugh (@RyanCavanaugh) Daniel Rosenwasser (@DanielRosenwasser) This shouldn't be a bug but working as intended? WIthout the files being included in the project how can we know the symbol 'ID' is from
@datorama/akitato offer it?Let me know if we need to take any other action here. Thanks
- addedWorking as IntendedThe behavior described is the intended behavior; this is not a bugThe behavior described is the intended behavior; this is not a bugand removedBugA bug in TypeScriptA bug in TypeScript
on Jul 18, 2019 Is it possible to force tsserver to lookup all files up-front?
If i'm using a lot of dependencies, or a large project with many dependencies, i would prefer to have tsserver scan all files up-front, so i don't have to find where every symbol is defined every time.
As a user, i could choose between
- performance (i know where symbols are, i am going to do a few imports only)
- completeness (i can accept an initial performance tradeoff to get more pertinent results)
I can see how doing this by default would make the process slower, so could this be an opt-in setting that forces tsserver to parse all files up-front eagerly? (user be warned: 'it will be slow', or something among those lines)
Thank you
- locked as resolved and limited conversation to collaborators
on Oct 21, 2025
VSCode Version:
Version 1.29.1
Typescript 3.1.4
OS Version:
macOS 10.14.1
Steps to Reproduce:
Create new angular app:
ng new appAdd new library:
yarn add @datorama/akitaCreate session.model.ts:
Auto import is not working. I get this error:
Starting VSCode with
code --disable-extensionsdidn't help :(