bluwy/create-vite-extra

TypeScript error in src/entry-server.tsx

borzaka opened this issue · 3 comments

I'am using the ssr-react-ts template under Windows 10.

entry-server.tsx:

...
import App from './App'
...

TS Error:

TS6307: File
D:/work/vite-extra-project/src/App.tsx
is not listed within the file list of project
D:/work/vite-extra-project/tsconfig.node.json
. Projects must list all files or use an include pattern.

tsconfig.node.json:

{
  "compilerOptions": {
    "composite": true,
    "skipLibCheck": true,
    "module": "ESNext",
    "moduleResolution": "bundler",
    "allowSyntheticDefaultImports": true,
    "jsx": "preserve"
  },
  "include": [
    "vite.config.ts",
    "src/entry-server.tsx",
    "src/vite-env.d.ts"
  ]
}

Thanks! It seems like a new TypeScript requirement to also require App.tsx in tsconfig.node.json. Adding that fixes it for me.

Hmm that didn't quite work. It needs to be added to all depended files recursively, so if App.tsx relies on other *.tsx components too, they need to be added to the include list. I think I'll just remove the src/* reference for now until there's a better way around it.

Fixed in 5aa3f78