Typescript: TS 3.5.2 Error: No Project

Created on 12 Aug 2019  路  11Comments  路  Source: microsoft/TypeScript

Version: 3.5.2

While editing TS type checking just stucks.

There is such output in the log

Err 1297  [2:38:30.802] Exception on executing command {"seq":306,"type":"request","command":"definitionAndBoundSpan","arguments":{"file":"d:/Code/chartify/apps/payments/index.ts","line":176,"offset":58}}:

    No Project.

    Error: No Project.
        at Object.ThrowNoProject (c:\Users\alexo\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\extensions\node_modules\typescript\lib\tsserver.js:124624:23)
        at ProjectService.doEnsureDefaultProjectForFile (c:\Users\alexo\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\extensions\node_modules\typescript\lib\tsserver.js:127469:131)
        at ProjectService.ensureDefaultProjectForFile (c:\Users\alexo\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\extensions\node_modules\typescript\lib\tsserver.js:127464:75)
        at IOSession.Session.getFileAndProjectWorker (c:\Users\alexo\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\extensions\node_modules\typescript\lib\tsserver.js:130982:87)
        at IOSession.Session.getFileAndProject (c:\Users\alexo\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\extensions\node_modules\typescript\lib\tsserver.js:130965:29)
        at IOSession.Session.getDefinitionAndBoundSpan (c:\Users\alexo\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\extensions\node_modules\typescript\lib\tsserver.js:130653:31)
        at Session.handlers.ts.createMapFromTemplate._a.(anonymous function) (c:\Users\alexo\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\extensions\node_modules\typescript\lib\tsserver.js:130011:61)
        at c:\Users\alexo\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\extensions\node_modules\typescript\lib\tsserver.js:131665:88
        at IOSession.Session.executeWithRequestId (c:\Users\alexo\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\extensions\node_modules\typescript\lib\tsserver.js:131656:28)
        at IOSession.Session.executeCommand (c:\Users\alexo\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\extensions\node_modules\typescript\lib\tsserver.js:131665:33)
        at IOSession.Session.onMessage (c:\Users\alexo\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\extensions\node_modules\typescript\lib\tsserver.js:131687:35)
        at Interface.<anonymous> (c:\Users\alexo\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\extensions\node_modules\typescript\lib\tsserver.js:132978:27)
        at Interface.emit (events.js:182:13)
        at Interface._onLine (readline.js:290:10)
        at Interface._normalWrite (readline.js:433:12)
        at Socket.ondata (readline.js:149:10)
        at Socket.emit (events.js:182:13)
        at addChunk (_stream_readable.js:283:12)
        at readableAddChunk (_stream_readable.js:264:11)
        at Socket.Readable.push (_stream_readable.js:219:10)
        at Pipe.onStreamRead [as onread] (internal/stream_base_commons.js:94:17)
Info 1298 [2:38:30.802] response:
    {"seq":0,"type":"response","command":"definitionAndBoundSpan","request_seq":306,"success":false,"message":"Error processing request. No Project.\nError: No Project.\n    at Object.ThrowNoProject (c:\\Users\\alexo\\AppData\\Local\\Programs\\Microsoft VS Code Insiders\\resources\\app\\extensions\\node_modules\\typescript\\lib\\tsserver.js:124624:23)\n    at ProjectService.doEnsureDefaultProjectForFile (c:\\Users\\alexo\\AppData\\Local\\Programs\\Microsoft VS Code Insiders\\resources\\app\\extensions\\node_modules\\typescript\\lib\\tsserver.js:127469:131)\n    at ProjectService.ensureDefaultProjectForFile (c:\\Users\\alexo\\AppData\\Local\\Programs\\Microsoft VS Code Insiders\\resources\\app\\extensions\\node_modules\\typescript\\lib\\tsserver.js:127464:75)\n    at IOSession.Session.getFileAndProjectWorker (c:\\Users\\alexo\\AppData\\Local\\Programs\\Microsoft VS Code Insiders\\resources\\app\\extensions\\node_modules\\typescript\\lib\\tsserver.js:130982:87)\n    at IOSession.Session.getFileAndProject (c:\\Users\\alexo\\AppData\\Local\\Programs\\Microsoft VS Code Insiders\\resources\\app\\extensions\\node_modules\\typescript\\lib\\tsserver.js:130965:29)\n    at IOSession.Session.getDefinitionAndBoundSpan (c:\\Users\\alexo\\AppData\\Local\\Programs\\Microsoft VS Code Insiders\\resources\\app\\extensions\\node_modules\\typescript\\lib\\tsserver.js:130653:31)\n    at Session.handlers.ts.createMapFromTemplate._a.(anonymous function) (c:\\Users\\alexo\\AppData\\Local\\Programs\\Microsoft VS Code Insiders\\resources\\app\\extensions\\node_modules\\typescript\\lib\\tsserver.js:130011:61)\n    at c:\\Users\\alexo\\AppData\\Local\\Programs\\Microsoft VS Code Insiders\\resources\\app\\extensions\\node_modules\\typescript\\lib\\tsserver.js:131665:88\n    at IOSession.Session.executeWithRequestId (c:\\Users\\alexo\\AppData\\Local\\Programs\\Microsoft VS Code Insiders\\resources\\app\\extensions\\node_modules\\typescript\\lib\\tsserver.js:131656:28)\n    at IOSession.Session.executeCommand (c:\\Users\\alexo\\AppData\\Local\\Programs\\Microsoft VS Code Insiders\\resources\\app\\extensions\\node_modules\\typescript\\lib\\tsserver.js:131665:33)\n    at IOSession.Session.onMessage (c:\\Users\\alexo\\AppData\\Local\\Programs\\Microsoft VS Code Insiders\\resources\\app\\extensions\\node_modules\\typescript\\lib\\tsserver.js:131687:35)\n    at Interface.<anonymous> (c:\\Users\\alexo\\AppData\\Local\\Programs\\Microsoft VS Code Insiders\\resources\\app\\extensions\\node_modules\\typescript\\lib\\tsserver.js:132978:27)\n    at Interface.emit (events.js:182:13)\n    at Interface._onLine (readline.js:290:10)\n    at Interface._normalWrite (readline.js:433:12)\n    at Socket.ondata (readline.js:149:10)\n    at Socket.emit (events.js:182:13)\n    at addChunk (_stream_readable.js:283:12)\n    at readableAddChunk (_stream_readable.js:264:11)\n    at Socket.Readable.push (_stream_readable.js:219:10)\n    at Pipe.onStreamRead [as onread] (internal/stream_base_commons.js:94:17)"}
Info 1299 [2:38:33.292] request:
    {"seq":307,"type":"request","command":"updateOpen","arguments":{"changedFiles":[],"closedFiles":["d:/Code/chartify/node_modules/cloudpayments/dist/NotificationHandlers.d.ts"],"openFiles":[]}}
Info 1300 [2:38:33.292] Open files: 
Info 1300 [2:38:33.292] Open files: 
Perf 1300 [2:38:33.292] 307::updateOpen: elapsed time (in milliseconds) 0.3813
Info 1301 [2:38:33.292] response:
    {"seq":0,"type":"response","command":"updateOpen","request_seq":307,"success":true,"body":true}
Info 1302 [2:38:33.293] request:
    {"seq":308,"type":"request","command":"geterr","arguments":{"delay":0,"files":["d:/Code/chartify/apps/client/cycles/SyncManager/OrderCommands.ts","d:/Code/chartify/apps/client/cycles/ChartArea/PrintOrderBlock.ts","d:/Code/chartify/apps/client/cycles/ChartArea/dict/ru.ts","d:/Code/chartify/client/dom/dom.ts","d:/Code/chartify/apps/client/styles.ts","d:/Code/chartify/apps/client/styles-appear.ts","d:/Code/chartify/apps/client/cycles/OrdersPage/OrdersPage.ts","d:/Code/chartify/apps/client/cycles/LifeMain.ts","d:/Code/chartify/apps/client/cycles/NotificationsDisplay.ts","d:/Code/chartify/client/payment-driver/index.ts","d:/Code/chartify/apps/payments/index.ts","d:/Code/chartify/apps/api-server/handlers/orders.ts","d:/Code/chartify/apps/payments/client.ts","d:/Code/chartify/apps/api-server/index.ts"]}}
Info 1303 [2:38:33.293] event:
    {"seq":0,"type":"event","event":"requestCompleted","body":{"request_seq":308}}
Perf 1304 [2:38:33.293] 308::geterr: async elapsed time (in milliseconds) 0.3998

Link to the log:
https://gist.github.com/whitecolor/81e376b04ee2021328d00b90aa18c9bb

I tried to add disableSizeLimit: true, no luck.

The first error message in the log is strange

Could not find file "d:/Code/chartify/apps/payments/index.ts".

This is the file I'm editing.

Needs More Info

Most helpful comment

@sheetalkamat I can reproduce this consistently on my end, although I have not sit down to carefully examinate my steps and describe it eloquently with well-defined steps. Let me know if you think this is enough information.

Disclaimer: The technical details' parts are pure speculation from empirical evidence. I am not familiar with tsserver's code base.

The logs' relevant parts are included completely in the examples below, despite them being short. That is because it either fails at the start and crashes (in the bad case), or continues without errors whatsoever for the rest of my editing session (in the successful case).

I am using Neovim and that might be an important detail, as it relates to @joefiorini 's problem (he's also using a Vim editor).

Steps

When I start the project at the root, let's say:

  1. cd /home/user/rena/ReactNativePrototype
  2. nvim App.tsx (i.e. using a relative path while already at the project's folder)

it works fine 100% of the time. :heavy_check_mark:. Notice how the tsconfig.json is correctly inferred when I'm opening it at the root already (-> Search path: /home/reaysawa/rena/ReactNativePrototype).

Info 0    [6:29:8.603] Starting TS Server
Info 1    [6:29:8.603] Version: 3.7.4
Info 2    [6:29:8.603] Arguments: /usr/bin/node /home/reaysawa/rena/ReactNativePrototype/node_modules/.bin/tsserver
Info 3    [6:29:8.603] Platform: linux NodeVersion: 13 CaseSensitive: true
Info 4    [6:29:8.611] Search path: /home/reaysawa/rena/ReactNativePrototype
Info 5    [6:29:8.611] For info: /home/reaysawa/rena/ReactNativePrototype/App.tsx :: Config file name: /home/reaysawa/rena/ReactNativePrototype/tsconfig.json
Info 6    [6:29:8.611] Opened configuration file /home/reaysawa/rena/ReactNativePrototype/tsconfig.json
Info 7    [6:29:8.813] Config: /home/reaysawa/rena/ReactNativePrototype/tsconfig.json

However, if I'm not at the project's folder already:

  1. cd /home/user/
  2. nvim rena/ReactNative/App.tsx (i.e. using a relative path while not at the project's folder)

That fails 100% of the time. :no_entry_sign:

Info 2    [6:9:33.761] Arguments: /usr/bin/node /home/reaysawa/rena/ReactNativePrototype/node_modules/.bin/tsserver
Info 3    [6:9:33.761] Platform: linux NodeVersion: 13 CaseSensitive: true
Err 4     [6:9:33.770] Could not find file "/home/reaysawa/rena/ReactNativePrototype/App.tsx".
All files are: []
Err 5     [6:9:33.780] Exception on executing command {"seq":2,"type":"request","command":"semanticDiagnosticsSync","arguments":{"file":"/home/reaysawa/rena/ReactNativePrototype/App.tsx","includeLinePosition":true}}:

From @whitecolor 's logs, you can see it's sending the absolute file path to the server, same as it's happening to me.

Summary

I can reproduce the error 100% of the time under my setup.

I believe the clients sometimes sends a path that's not perfectly in sync with the current root inferred by tsserver.

This would also make sense for @joefiorini's description. In the midst of changing through different directories, the client might sometimes send paths that are not perfectly in sync with the server's inferred root (or simply sends absolute file paths, for whatever reason). Like him, I'm also using a terminal-based editor (Neovim) and not VSCode.

All 11 comments

@whitecolor Please provide complete log without removing project information to able to investigate this. You can send the logs privately by emailing me: shkamat at microsoft dot com

Also you should try using typescript nightly drop to see if the issue repros and if does the logs with that is recommended for easier investigation.

@whitecolor Please provide complete log without removing project information to able to investigate this. You can send the logs privately by emailing me: shkamat at microsoft dot com

I had set ts server log level to verbose.

But now when open logs again (after typecheck process was broken again) I get the following log:
https://gist.github.com/whitecolor/9177463cead0ae02cc0b92b7d99bb695

What you mean without removing project information?

The log shared isn't from nightly but from typescript 3.5.3 I am not sure which editor you are using or there is log you are skipping but your log doesn't have open command and its calling getApplicableRefactors before opening the file and that is correct in throwing exception. (https://gist.github.com/whitecolor/9177463cead0ae02cc0b92b7d99bb695#file-tsserver-log-L17)

I'm using the latest vscode insiders, but the same happened on the latest vscode stable.

Today I've switched the project to the latest TS 3.7-dev, will report if happens again.

Well even if doesn't (which I'm kind of in doubt of), it would good to understand would can/could cause this.

This error happens again

Info 0    [16:41:50.598] Starting TS Server
Info 1    [16:41:50.599] Version: 3.7.0-dev.20190817
Info 2    [16:41:50.599] Arguments: C:\Users\alexo\AppData\Local\Programs\Microsoft VS Code Insiders\Code - Insiders.exe d:\Code\chartify\node_modules\typescript\lib\tsserver.js --useInferredProjectPerProjectRoot --disableAutomaticTypingAcquisition --enableTelemetry --cancellationPipeName C:\Users\alexo\AppData\Local\Temp\vscode-typescript\97717d2da6af46470ccd\tscancellation-a5a98b3604b5eec0149b.tmp* --logVerbosity verbose --logFile c:\Users\alexo\AppData\Roaming\Code - Insiders\logs\20190819T145635\exthost4\vscode.typescript-language-features\tsserver-log-2vTzxH\tsserver.log --locale en --noGetErrOnBackgroundUpdate --validateDefaultNpmLocation
Info 3    [16:41:50.599] Platform: win32 NodeVersion: 10 CaseSensitive: false
Info 4    [16:41:50.603] request:
    {"seq":0,"type":"request","command":"configure","arguments":{"hostInfo":"vscode","preferences":{"providePrefixAndSuffixTextForRename":true,"allowRenameOfImportPath":true}}}
Info 5    [16:41:50.603] Host information vscode
Info 6    [16:41:50.603] response:
    {"seq":0,"type":"response","command":"configure","request_seq":0,"success":true}
Perf 7    [16:41:50.604] 0::configure: async elapsed time (in milliseconds) 1.0205
Info 8    [16:41:50.604] request:
    {"seq":1,"type":"request","command":"compilerOptionsForInferredProjects","arguments":{"options":{"module":"commonjs","target":"es2016","jsx":"preserve","checkJs":true,"allowJs":true,"allowSyntheticDefaultImports":true,"allowNonTsExtensions":true}}}
Info 9    [16:41:50.605] Scheduled: *ensureProjectForOpenFiles*
Perf 10   [16:41:50.605] 1::compilerOptionsForInferredProjects: elapsed time (in milliseconds) 0.6135
Info 11   [16:41:50.605] response:
    {"seq":0,"type":"response","command":"compilerOptionsForInferredProjects","request_seq":1,"success":true,"body":true}
Info 12   [16:41:50.605] request:
    {"seq":2,"type":"request","command":"getApplicableRefactors","arguments":{"file":"d:/Code/chartify/apps/client/cycles/OrdersPage/OrdersPage.ts","startLine":271,"startOffset":38,"endLine":271,"endOffset":49}}
Info 13   [16:41:50.605] Structure before ensureProjectForOpenFiles:
Info 14   [16:41:50.605] Open files: 
Info 14   [16:41:50.605] Structure after ensureProjectForOpenFiles:
Info 15   [16:41:50.605] Open files: 
Err 15    [16:41:50.605] Could not find file "d:/Code/chartify/apps/client/cycles/OrdersPage/OrdersPage.ts".
All files are: []
Err 16    [16:41:50.617] Could not find file "d:/Code/chartify/apps/client/cycles/OrdersPage/OrdersPage.ts".
All files are: []
Err 17    [16:41:50.617] Exception on executing command {"seq":2,"type":"request","command":"getApplicableRefactors","arguments":{"file":"d:/Code/chartify/apps/client/cycles/OrdersPage/OrdersPage.ts","startLine":271,"startOffset":38,"endLine":271,"endOffset":49}}:

    No Project.

    Error: No Project.
        at Object.ThrowNoProject (d:\Code\chartify\node_modules\typescript\lib\tsserver.js:128204:23)
        at ProjectService.doEnsureDefaultProjectForFile (d:\Code\chartify\node_modules\typescript\lib\tsserver.js:131141:131)
        at ProjectService.ensureDefaultProjectForFile (d:\Code\chartify\node_modules\typescript\lib\tsserver.js:131136:75)
        at IOSession.Session.getFileAndProjectWorker (d:\Code\chartify\node_modules\typescript\lib\tsserver.js:134689:87)
        at IOSession.Session.getFileAndProject (d:\Code\chartify\node_modules\typescript\lib\tsserver.js:134672:29)
        at IOSession.Session.getApplicableRefactors (d:\Code\chartify\node_modules\typescript\lib\tsserver.js:135122:31)
        at Session.handlers.ts.createMapFromTemplate._a.(anonymous function) (d:\Code\chartify\node_modules\typescript\lib\tsserver.js:133979:61)
        at d:\Code\chartify\node_modules\typescript\lib\tsserver.js:135367:88
        at IOSession.Session.executeWithRequestId (d:\Code\chartify\node_modules\typescript\lib\tsserver.js:135358:28)
        at IOSession.Session.executeCommand (d:\Code\chartify\node_modules\typescript\lib\tsserver.js:135367:33)
        at IOSession.Session.onMessage (d:\Code\chartify\node_modules\typescript\lib\tsserver.js:135390:35)
        at Interface.<anonymous> (d:\Code\chartify\node_modules\typescript\lib\tsserver.js:136705:27)
        at Interface.emit (events.js:182:13)
        at Interface._onLine (readline.js:290:10)
        at Interface._normalWrite (readline.js:433:12)
        at Socket.ondata (readline.js:149:10)
        at Socket.emit (events.js:182:13)
        at addChunk (_stream_readable.js:283:12)
        at readableAddChunk (_stream_readable.js:264:11)
        at Socket.Readable.push (_stream_readable.js:219:10)
        at Pipe.onStreamRead [as onread] (internal/stream_base_commons.js:94:17)

Here is a TS log with normal level
https://gist.github.com/whitecolor/bf68f574b91c5be2c19a04b0252f31c1

rr 5     [17:54:41.777] Exception on executing command {"seq":2,"type":"request","command":"change","arguments":{"insertString":"","file":"d:/Code/chartify/apps/client/cycles/OrdersPage/OrdersPage.ts","line":671,"offset":27,"endLine":671,"endOffset":34}}:

    Debug Failure. False expression.

    Error: Debug Failure. False expression.
        at IOSession.Session.change (d:\Code\chartify\node_modules\typescript\lib\tsserver.js:134967:26)
        at Session.handlers.ts.createMapFromTemplate._a.(anonymous function) (d:\Code\chartify\node_modules\typescript\lib\tsserver.js:133891:31)
        at d:\Code\chartify\node_modules\typescript\lib\tsserver.js:135367:88
        at IOSession.Session.executeWithRequestId (d:\Code\chartify\node_modules\typescript\lib\tsserver.js:135358:28)
        at IOSession.Session.executeCommand (d:\Code\chartify\node_modules\typescript\lib\tsserver.js:135367:33)
        at IOSession.Session.onMessage (d:\Code\chartify\node_modules\typescript\lib\tsserver.js:135390:35)
        at Interface.<anonymous> (d:\Code\chartify\node_modules\typescript\lib\tsserver.js:136705:27)
        at Interface.emit (events.js:182:13)
        at Interface._onLine (readline.js:290:10)
        at Interface._normalWrite (readline.js:433:12)
        at Socket.ondata (readline.js:149:10)
        at Socket.emit (events.js:182:13)
        at addChunk (_stream_readable.js:283:12)
        at readableAddChunk (_stream_readable.js:264:11)
        at Socket.Readable.push (_stream_readable.js:219:10)
        at Pipe.onStreamRead [as onread] (internal/stream_base_commons.js:94:17)
Info 6    [17:54:41.777] Structure before ensureProjectForOpenFiles:
Info 7    [17:54:41.777] Open files: 
Info 7    [17:54:41.777] Structure after ensureProjectForOpenFiles:
Info 8    [17:54:41.777] Open files: 
Err 8     [17:54:41.777] Could not find file "d:/Code/chartify/apps/client/cycles/OrdersPage/OrdersPage.ts".
All files are: []
Err 9     [17:54:41.778] Exception on executing command {"seq":3,"type":"request","command":"getApplicableRefactors","arguments":{"file":"d:/Code/chartify/apps/client/cycles/OrdersPage/OrdersPage.ts","startLine":671,"startOffset":27,"endLine":671,"endOffset":27}}:

nodejs verison is v12.1.0

Created microsoft/vscode#79650 since seems like vscode issue.

@sheetalkamat I can say that I'm getting this error multiple times a day using coc-tsserver in NeoVim. We have appx. 1,100 files (majority ts & tsx, but some js as well) in our project. Here's our tsconfig.json:

{
  "compilerOptions": {
    "target": "es5",
    "lib": ["dom", "dom.iterable", "esnext"],
    "allowJs": true,
    "skipLibCheck": true,
    "esModuleInterop": true,
    "allowSyntheticDefaultImports": true,
    "strict": true,
    "forceConsistentCasingInFileNames": true,
    "module": "esnext",
    "moduleResolution": "node",
    "resolveJsonModule": true,
    "isolatedModules": true,
    "noEmit": true,
    "jsx": "preserve",
    "baseUrl": ".",
    "types": [
      "@emotion/core",
      "jest",
      "@testing-library/jest-dom/extend-expect",
      "@pillclub/support/jest/matchers"
    ],
    "paths": {
      "@original-emotion/styled": ["./node_modules/@emotion/styled"],
      "@emotion/styled": ["./core/themes/styled"]
    }
  },
  "exclude": ["support/generators/*", "sites/*/public", "sites/*/.cache", ".eslintrc.js"]
}

I unfortunately have not had the chance to dig for more details, but wanted to raise my hand and say that this may not be just a vscode issue. Or coc-tsserver is doing something the same way as vscode that's triggering this. Also, I don't have an error report right now, but next time it happens I'll update this comment with it.

@sheetalkamat I can reproduce this consistently on my end, although I have not sit down to carefully examinate my steps and describe it eloquently with well-defined steps. Let me know if you think this is enough information.

Disclaimer: The technical details' parts are pure speculation from empirical evidence. I am not familiar with tsserver's code base.

The logs' relevant parts are included completely in the examples below, despite them being short. That is because it either fails at the start and crashes (in the bad case), or continues without errors whatsoever for the rest of my editing session (in the successful case).

I am using Neovim and that might be an important detail, as it relates to @joefiorini 's problem (he's also using a Vim editor).

Steps

When I start the project at the root, let's say:

  1. cd /home/user/rena/ReactNativePrototype
  2. nvim App.tsx (i.e. using a relative path while already at the project's folder)

it works fine 100% of the time. :heavy_check_mark:. Notice how the tsconfig.json is correctly inferred when I'm opening it at the root already (-> Search path: /home/reaysawa/rena/ReactNativePrototype).

Info 0    [6:29:8.603] Starting TS Server
Info 1    [6:29:8.603] Version: 3.7.4
Info 2    [6:29:8.603] Arguments: /usr/bin/node /home/reaysawa/rena/ReactNativePrototype/node_modules/.bin/tsserver
Info 3    [6:29:8.603] Platform: linux NodeVersion: 13 CaseSensitive: true
Info 4    [6:29:8.611] Search path: /home/reaysawa/rena/ReactNativePrototype
Info 5    [6:29:8.611] For info: /home/reaysawa/rena/ReactNativePrototype/App.tsx :: Config file name: /home/reaysawa/rena/ReactNativePrototype/tsconfig.json
Info 6    [6:29:8.611] Opened configuration file /home/reaysawa/rena/ReactNativePrototype/tsconfig.json
Info 7    [6:29:8.813] Config: /home/reaysawa/rena/ReactNativePrototype/tsconfig.json

However, if I'm not at the project's folder already:

  1. cd /home/user/
  2. nvim rena/ReactNative/App.tsx (i.e. using a relative path while not at the project's folder)

That fails 100% of the time. :no_entry_sign:

Info 2    [6:9:33.761] Arguments: /usr/bin/node /home/reaysawa/rena/ReactNativePrototype/node_modules/.bin/tsserver
Info 3    [6:9:33.761] Platform: linux NodeVersion: 13 CaseSensitive: true
Err 4     [6:9:33.770] Could not find file "/home/reaysawa/rena/ReactNativePrototype/App.tsx".
All files are: []
Err 5     [6:9:33.780] Exception on executing command {"seq":2,"type":"request","command":"semanticDiagnosticsSync","arguments":{"file":"/home/reaysawa/rena/ReactNativePrototype/App.tsx","includeLinePosition":true}}:

From @whitecolor 's logs, you can see it's sending the absolute file path to the server, same as it's happening to me.

Summary

I can reproduce the error 100% of the time under my setup.

I believe the clients sometimes sends a path that's not perfectly in sync with the current root inferred by tsserver.

This would also make sense for @joefiorini's description. In the midst of changing through different directories, the client might sometimes send paths that are not perfectly in sync with the server's inferred root (or simply sends absolute file paths, for whatever reason). Like him, I'm also using a terminal-based editor (Neovim) and not VSCode.

I'm experiencing this with neovim and coc-tsserver as well

Was this page helpful?
0 / 5 - 0 ratings