Skip to content

TS Server not picking up new TS files in vscode on MacOS #33564

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

Closed
mjbvz opened this issue Sep 23, 2019 · 8 comments
Closed

TS Server not picking up new TS files in vscode on MacOS #33564

mjbvz opened this issue Sep 23, 2019 · 8 comments
Assignees
Labels
Needs Investigation This issue needs a team member to investigate its status. VS Code Priority Critical issues that VS Code needs fixed in the current TypeScript milestone

Comments

@mjbvz
Copy link
Contributor

mjbvz commented Sep 23, 2019

TypeScript Version: 3.7.0-dev.20190922

Search Terms:

  • create-react-app
  • project configuration
  • tsconfig

Repo

  1. npx create-react-app my-app --typescript

  2. Open my-app in VS Code

  3. Open app.tsx

  4. Now create a new file next to it called add.ts with the content:

    export function add() {}
  5. Run the go to project configuration command in VS Code with add.ts open:

    • 🐛 Says it's not part of any configured project
  6. Now go back to App.tsx and try using completions to add an auto import for add

    • 🐛 Auto import never works (unless you add an import manually)

Here are the logs:
log.txt

@mjbvz
Copy link
Contributor Author

mjbvz commented Sep 23, 2019

This repos for me with 3.6.3 and for very simple projects like the following:

tsconfig.js

{
    "compilerOptions": {
        "module": "commonjs",
        "target": "es2016",
        "jsx": "react"
    }
}

src/main.ts

export function foo() {
    add
}

src/add.ts (must be newly created)

export function add() { }

I don't know why we haven't seen this reported on the VS Code side (to my knowledge) but this bug is really annoying. @RyanCavanaugh @sheetalkamat I think this is worth at least investigating for a 3.6.x recovery

@sheetalkamat
Copy link
Member

@mjbvz in the logs you showed there is only updateOpen but directory watcher for wild card directories is never invoked and that's the reason project doesn't know about app.tsx being part of it..

Info 80   [11:20:43.245] request:
    {"seq":14,"type":"request","command":"updateOpen","arguments":{"changedFiles":[],"closedFiles":[],"openFiles":[{"file":"/Users/matb/projects/san/sub/my-app/src/add.ts","fileContent":"","scriptKindName":"TS","projectRootPath":"/Users/matb/projects/san/sub/my-app"}]}}

When I repro your scenario (simple one) I don't see that behavior...

import

@mjbvz
Copy link
Contributor Author

mjbvz commented Sep 23, 2019

This was with the latest VS Code 1.39 insiders for me with MacOS 10.14.6. I've been able to repo the create-react-app issues it on two macs. Let me give it a quick try on my windows vm too

@mjbvz
Copy link
Contributor Author

mjbvz commented Sep 23, 2019

Seems to work ok on windows using create-react-app

@RyanCavanaugh RyanCavanaugh added the Needs Investigation This issue needs a team member to investigate its status. label Sep 25, 2019
@RyanCavanaugh RyanCavanaugh added this to the TypeScript 3.8.0 milestone Sep 25, 2019
@mjbvz mjbvz added the VS Code Priority Critical issues that VS Code needs fixed in the current TypeScript milestone label Sep 26, 2019
@mjbvz
Copy link
Contributor Author

mjbvz commented Sep 26, 2019

This could be related to our electron update (which goes from node 10.11 to node 12.4). I can't seem to repo with the current stable VS Code builds using typescript@next

It definitely happens pretty consistently on mac VS Code insiders for me though. @RyanCavanaugh We need to investigate this before VS Code 1.39 ships


edit

The bug also repos using TS 3.5.3 so it does look more like an environment issue.

Possibly relevant: nodejs/node#29460 . We should be able to confirm/disprove this theory by running the same version of TS Server on MacOS using node 10.11 and Node 12.4 and seeing if the behavior is different

@mjbvz mjbvz changed the title create-react-app --typescript project not picking up new ts files in vscode TS Server not picking up new TS files in vscode on MacOS Sep 26, 2019
@mjbvz
Copy link
Contributor Author

mjbvz commented Sep 30, 2019

We have reverted our Electron update for this release as this bug also effects other extensions

Closing this TS side issue in favor of the VS Code issue: microsoft/vscode#81516

@mjbvz mjbvz closed this as completed Sep 30, 2019
@danilofuchs
Copy link

This is still an issue for me, running the latest stable VSCode version. @mjbvz was there any regressions since it was fixed in electron 6?

@mjbvz
Copy link
Contributor Author

mjbvz commented Mar 31, 2020

@danilofuchs Please open a new issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Investigation This issue needs a team member to investigate its status. VS Code Priority Critical issues that VS Code needs fixed in the current TypeScript milestone
Projects
None yet
Development

No branches or pull requests

4 participants