Closed amelekhin closed 4 days ago
Wow, apparently it is related to the fact that I accidentally created a package.json
outside the project directory. The file was empty, but somehow it affects the project, even though there is a package.json
within the project directory. So it's not vanilla-ts
to blame.
I will close this issue, however perhaps it's still something worth looking into.
Describe the bug
npm create-vite@latest
with thevanilla-ts
template produces a broken build. I have got the same results with Node versions 20 and 22 and withnpm
andpnpm
package managers. I assume that there is a bug with reading or parsing JSON files. Please see the full reproduction in the attached repo.Reproduction
https://github.com/amelekhin/vite-vanilla-ts
Steps to reproduce
npm run dev
.System Info
Used Package Manager
npm
Logs
Click to expand!
```shell ~/Development/Projects via Node v22.10.0 ❯ npm create vite@latest ✔ Project name: … vite-vanilla-ts ✔ Select a framework: › Vanilla ✔ Select a variant: › TypeScript Scaffolding project in /Users/anton/Development/Projects/vite-vanilla-ts... Done. Now run: cd vite-vanilla-ts npm install npm run dev ~/Development/Projects via Node v22.10.0 took 8s ❯ cd vite-vanilla-ts Development/Projects/vite-vanilla-ts via Node v22.10.0 ❯ npm install added 12 packages, and audited 13 packages in 2s 3 packages are looking for funding run `npm fund` for details found 0 vulnerabilities Development/Projects/vite-vanilla-ts via v22.10.0 took 2s ❯ npm run dev > vite-vanilla-ts@0.0.0 dev > vite VITE v5.4.9 ready in 360 ms ➜ Local: http://localhost:5173/ ➜ Network: use --host to expose ➜ press h + enter to show help undefined:1 [Failed to load PostCSS config: Failed to load PostCSS config (searchPath: /Users/anton/Development/Projects/vite-vanilla-ts): [SyntaxError] Unexpected end of JSON input SyntaxError: Unexpected end of JSON input at JSON.parse (Validations