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: New files in VS Code produce the error "Parsing error: [file] was not found by the project service." #1155

Closed
njbair opened this issue Aug 21, 2024 · 3 comments · Fixed by #1167

Comments

@njbair
Copy link

njbair commented Aug 21, 2024

Provide environment information

  System:
    OS: macOS 14.6.1
    CPU: (10) arm64 Apple M1 Pro
    Memory: 77.55 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.16.0 - ~/.nvm/versions/node/v20.16.0/bin/node
    npm: 10.8.1 - ~/.nvm/versions/node/v20.16.0/bin/npm
    pnpm: 9.6.0 - ~/Library/pnpm/pnpm
    bun: 1.1.20 - ~/.bun/bin/bun

Describe the bug

Creating new files in the Next.js app produces linting errors in VS Code. Only workaround is restarting the editor.

Link to reproduction

https://github.com/t3-oss/create-t3-turbo

To reproduce

Clone the stock repo using the CLI command from the docs:

npx create-turbo@latest -e https://github.com/t3-oss/create-t3-turbo

Open in VS Code:

cd ./my-turborepo
code .

Create a new TS file anywhere in the apps/nextjs/src directory:

code apps/nextjs/src/test.ts

Save the empty file. Observe the red tilde under the cursor, which provides the following error:

Parsing error: [path]/my-turborepo/apps/nextjs/src/test.ts was not found by the project service. Consider either including it in the tsconfig.json or including it in allowDefaultProject.eslint

Additional information

Restarting the TS server does not help. Only workaround I can find is restarting VS Code entirely.
EDIT: I can also close and re-open the workspace instead of restarting the editor.

@EvgenyBorisov
Copy link

I have similar problem in my next.js project with eslint flat config.

@jpainam
Copy link

jpainam commented Aug 27, 2024

Faicing the same issue, had to restart VS code.

@VaniaPopovic
Copy link
Contributor

Seems the issue is upstream but typescript-eslint 8.3.0 might fix the issue
microsoft/vscode-eslint#1911

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants