Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tsserver unable to find tsconfig.json regardless of location relative to source files #32039

Closed
hbomb79 opened this issue Jun 22, 2019 · 7 comments
Labels
Needs More Info The issue still hasn't been fully clarified

Comments

@hbomb79
Copy link

hbomb79 commented Jun 22, 2019

TypeScript Version: 3.5.2

Search Terms: tsserver config module not found logging missing cygwin

Code

Log file from tsserver

Info 0    [18:41:44.988] Starting TS Server
Info 1    [18:41:44.989] Version: 3.6.0-dev.20190622
Info 2    [18:41:44.989] Arguments: C:\Program Files\nodejs\node.exe C:\cygwin64\home\HarryF\ImportProcessor\node_modules\typescript\bin\tsserver
Info 3    [18:41:44.989] Platform: win32 NodeVersion: 12 CaseSensitive: false
Info 4    [18:41:44.993] Binding...
Info 5    [18:41:44.997] event:
    {"seq":0,"type":"event","event":"typingsInstallerPid","body":{"pid":13244}}
Info 6    [18:41:44.999] request:
    {"seq":null,"arguments":{"file":"/home/HarryF/ImportProcessor/src/classes/Application.ts"},"type":"request","command":"open"}
Info 7    [18:41:44.999] Search path: /home/HarryF/ImportProcessor/src/classes
Info 8    [18:41:45.0] ConfigFilePresence:: Current Watches: :: File: /home/HarryF/ImportProcessor/src/classes/tsconfig.json Currently impacted open files: RootsOfInferredProjects:  OtherOpenFiles: /home/HarryF/ImportProcessor/src/classes/Application.ts Status: File added to open files impacted by this config file
Info 9    [18:41:45.0] ConfigFilePresence:: Current Watches: :: File: /home/HarryF/ImportProcessor/src/classes/jsconfig.json Currently impacted open files: RootsOfInferredProjects:  OtherOpenFiles: /home/HarryF/ImportProcessor/src/classes/Application.ts Status: File added to open files impacted by this config file
Info 10   [18:41:45.1] ConfigFilePresence:: Current Watches: :: File: /home/HarryF/ImportProcessor/src/tsconfig.json Currently impacted open files: RootsOfInferredProjects:  OtherOpenFiles: /home/HarryF/ImportProcessor/src/classes/Application.ts Status: File added to open files impacted by this config file
Info 11   [18:41:45.1] ConfigFilePresence:: Current Watches: :: File: /home/HarryF/ImportProcessor/src/jsconfig.json Currently impacted open files: RootsOfInferredProjects:  OtherOpenFiles: /home/HarryF/ImportProcessor/src/classes/Application.ts Status: File added to open files impacted by this config file
Info 12   [18:41:45.1] ConfigFilePresence:: Current Watches: :: File: /home/HarryF/ImportProcessor/tsconfig.json Currently impacted open files: RootsOfInferredProjects:  OtherOpenFiles: /home/HarryF/ImportProcessor/src/classes/Application.ts Status: File added to open files impacted by this config file
Info 13   [18:41:45.1] ConfigFilePresence:: Current Watches: :: File: /home/HarryF/ImportProcessor/jsconfig.json Currently impacted open files: RootsOfInferredProjects:  OtherOpenFiles: /home/HarryF/ImportProcessor/src/classes/Application.ts Status: File added to open files impacted by this config file
Info 14   [18:41:45.1] ConfigFilePresence:: Current Watches: :: File: /home/HarryF/tsconfig.json Currently impacted open files: RootsOfInferredProjects:  OtherOpenFiles: /home/HarryF/ImportProcessor/src/classes/Application.ts Status: File added to open files impacted by this config file
Info 15   [18:41:45.1] ConfigFilePresence:: Current Watches: :: File: /home/HarryF/jsconfig.json Currently impacted open files: RootsOfInferredProjects:  OtherOpenFiles: /home/HarryF/ImportProcessor/src/classes/Application.ts Status: File added to open files impacted by this config file
Info 16   [18:41:45.1] ConfigFilePresence:: Current Watches: :: File: /home/tsconfig.json Currently impacted open files: RootsOfInferredProjects:  OtherOpenFiles: /home/HarryF/ImportProcessor/src/classes/Application.ts Status: File added to open files impacted by this config file
Info 17   [18:41:45.1] ConfigFilePresence:: Current Watches: :: File: /home/jsconfig.json Currently impacted open files: RootsOfInferredProjects:  OtherOpenFiles: /home/HarryF/ImportProcessor/src/classes/Application.ts Status: File added to open files impacted by this config file
Info 18   [18:41:45.1] ConfigFilePresence:: Current Watches: :: File: /tsconfig.json Currently impacted open files: RootsOfInferredProjects:  OtherOpenFiles: /home/HarryF/ImportProcessor/src/classes/Application.ts Status: File added to open files impacted by this config file
Info 19   [18:41:45.1] ConfigFilePresence:: Current Watches: :: File: /jsconfig.json Currently impacted open files: RootsOfInferredProjects:  OtherOpenFiles: /home/HarryF/ImportProcessor/src/classes/Application.ts Status: File added to open files impacted by this config file
Info 20   [18:41:45.1] For info: /home/HarryF/ImportProcessor/src/classes/Application.ts :: No config files found.

Directory Structure

| tsconfig.json
| node_modules
| src
    | bootstrap.ts
    ...
| ...

tsconfig.json:

{
    "compilerOptions": {
        "outDir": "./built",
        "moduleResolution": "node"
    },
    "include":[
        "./src/**/*"
    ]
}

Running on Windows 10, Cygwin.

Expected behavior:
The configuration file tsconfig.json would be found and identified by tsserver. When running via tsc, the code is compiled as expected indicating the tsconfig.json file IS being loaded.

Actual behavior:
'No config files found' presented by tsserver. On a MacOS machine with a identical config, directory structure, and node packages, the config file is identified correctly.

The lack of this configuration file means that when using vim-ale to lint my Typescript projects, all modules come back as 'Unable to find module X' as the tsserver is not using the configuration file (namely, "moduleResolution": "node").

Playground Link: N/A

@hbomb79
Copy link
Author

hbomb79 commented Jun 22, 2019

Worth noting that /home/HarryF/ImportProcessor/tsconfig.json is the absolute path of the config file. In the tsserver log however, this is all I get regarding that path
Info 12 [18:41:45.1] ConfigFilePresence:: Current Watches: :: File: /home/HarryF/ImportProcessor/tsconfig.json Currently impacted open files: RootsOfInferredProjects: OtherOpenFiles: /home/HarryF/ImportProcessor/src/classes/Application.ts Status: File added to open files impacted by this config file

I don't even fully understand what that means, but for one reason or another that config file is simply not being used and tsserver is using an 'inferredProject'. Full log file can be provided if required.

The project can be found here.

@sheetalkamat
Copy link
Member

@hbomb79 I don't see this issue on my windows machine with the code you shared. Can you please share tsserver log to see if something went wrong? Thanks.

You can upload logs by following these steps:

  1. With "typescript.tsserver.log": "verbose" enabled
  2. Restart vscode or vscode insiders
  3. Reproduce the problem
  4. You can share the logs using
    • either by sharing logs in the folder that gets opened by running open tsserver log from command palette
      or
    • Run code --upload-logs on the command line (or code-insiders --upload-logs if using vscode insiders) and follow instructions and Then share the log file ID

@sheetalkamat sheetalkamat added the Needs More Info The issue still hasn't been fully clarified label Jun 24, 2019
@hbomb79
Copy link
Author

hbomb79 commented Jun 25, 2019

Hey @sheetalkamat, thanks for offering your assistance. I'm not using VSCode or anything like that; I'm simply running tsserver either directly or using the executable inside of node_modules/.bin. I don't have a open or code command to use, I assume they're related to VSCode?

This is the full log file from using export TSS_LOG='-level verbose' before running tsserver.

I've used pastebin to link to my log file as it's size was too large to include here.

@hbomb79
Copy link
Author

hbomb79 commented Jun 25, 2019

I'm using Windows with Cygwin; I can't use cmd as I only noticed to problem because vim is calling tsserver for it's linting; It isn't vims fault though as the problem appears even when I call tsserver myself.

tsserver was working for a time, and now it's magically stopped. I genuinely have no idea why.

@hbomb79
Copy link
Author

hbomb79 commented Jun 25, 2019

I just cleared out my npm as well, I now have no packages installed except typescript and the problem still occurs. The config file is right. there. Yet tsserver ignores it... I've tried pretty much everything I can over the last 4 days before resorting to filing an issue in the hopes of being pointed in the right direction as to what the problem is.

@sheetalkamat
Copy link
Member

Cant make out much from your tsserver log. May be check if tsserver process has access to the config file location.

@demfabris
Copy link

Sorry, @hbomb79 did you find anything? Currently experiencing this on GNU Linux and Vim + coc extensions

@RyanCavanaugh RyanCavanaugh closed this as not planned Won't fix, can't repro, duplicate, stale Aug 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs More Info The issue still hasn't been fully clarified
Projects
None yet
Development

No branches or pull requests

4 participants