t3-oss / create-t3-turbo

Clean and simple starter repo using the T3 Stack along with Expo React Native
https://turbo.t3.gg
MIT License
4.73k stars 408 forks source link

bug: New files in VS Code produce the error "Parsing error: [file] was not found by the project service." #1155

Closed njbair closed 2 months ago

njbair commented 3 months ago

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 commented 3 months ago

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

jpainam commented 3 months ago

Faicing the same issue, had to restart VS code.

VaniaPopovic commented 2 months ago

Seems the issue is upstream but typescript-eslint 8.3.0 might fix the issue https://github.com/microsoft/vscode-eslint/issues/1911