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

[bug] existing module shows as not found in VS Code #38495

Open
trusktr opened this issue May 12, 2020 · 4 comments
Open

[bug] existing module shows as not found in VS Code #38495

trusktr opened this issue May 12, 2020 · 4 comments
Labels
Needs More Info The issue still hasn't been fully clarified

Comments

@trusktr
Copy link

trusktr commented May 12, 2020

I marked this as [project-references?] because I started noticing these issues when I tried to switch a project to using --build. Not sure if it is actually related.

TypeScript Version: 3.8.3

Search Terms:

typescript no definition found for

Code

import './fake-process'

Expected behavior:

It should find the module, and I should be able to navigate to it in VS Code

Actual behavior:

existing-module-not-found

Playground Link:

Unfortunately I don't have a public reproduction yet; it is in a private repo.

Related Issues:

Possibly related: #38494

@sheetalkamat
Copy link
Member

We would need more information to be able to investigate if this is really bug or configuration issue.. We would need repro steps, tsserver log. You can also enable traceResolution in tsconfig to see why and where the module resolves to or doesnt resolve.

@sheetalkamat sheetalkamat added the Needs More Info The issue still hasn't been fully clarified label May 12, 2020
@trusktr
Copy link
Author

trusktr commented May 12, 2020

Ah, that's good info. Thanks! I will see if I can get more info.

@trusktr
Copy link
Author

trusktr commented May 12, 2020

@sheetalkamat I found this:

❯ npm run typecheck | grep fake
======== Resolving module './fake-process' from '/home/trusktr/src/my-project/apps/annotator/src/entry/index.ts'. ========
Loading module as file / folder, candidate module location '/home/trusktr/src/my-project/apps/annotator/src/entry/fake-process', target file type 'TypeScript'.
File '/home/trusktr/src/my-project/apps/annotator/src/entry/fake-process.ts' exist - use it as a name resolution result.
======== Module name './fake-process' was successfully resolved to '/home/trusktr/src/my-project/apps/annotator/src/entry/fake-process.ts'. ========

which seems to indicate that tsc is able to find the module, but it is only in VS Code that when I try to go to the definition it says No definition found.

@trusktr trusktr changed the title [bug] [project-references?] existing module shows as not found in VS Code [bug] existing module shows as not found in VS Code May 12, 2020
@trusktr
Copy link
Author

trusktr commented May 12, 2020

As for the TS Server log, I see an empty definitions response:

Info 504  [14:18:41.901] request:
    {"seq":74,"type":"request","command":"definitionAndBoundSpan","arguments":{"file":"/home/trusktr/src/my-project/apps/annotator/src/entry/index.ts","line":10,"offset":12}}
Perf 505  [14:18:41.902] 74::definitionAndBoundSpan: elapsed time (in milliseconds) 0.7504
Info 506  [14:18:41.902] response:
    {"seq":0,"type":"response","command":"definitionAndBoundSpan","request_seq":74,"success":true,"body":{"definitions":[]}}

I have two imports, and the second one works fine:

import './fake-process' // doesn't work
import './add-jquery-ui' // works

Both files are there as expected.

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

2 participants