vitejs / vite

Next generation frontend tooling. It's fast!
http://vite.dev
MIT License
68.42k stars 6.17k forks source link

malformed_package_json runs tests while vite is being run in regular dev mode causing fatal error. #16310

Closed houd1ni closed 7 months ago

houd1ni commented 7 months ago

Describe the bug

image

Reproduction

https://stackblitz.com/edit/vitejs-vite-zgkvff?file=index.html&terminal=dev

Steps to reproduce

vite ./project_dir --host

System Info

win10x64 32Gb 14600kf

Used Package Manager

npm

Logs

VITE v5.2.6 ready in 1330 ms

➜ Local: http://localhost:5173/ ➜ Network: http://192.168.1.3:5173/ ➜ press h + enter to show help Error: Failed to scan for dependencies from entries: C:/Users/pinke/p/menu-front/project/index.html

✘ [ERROR] Expected string in JSON but found end of file

node_modules/resolve/test/resolver/malformed_package_json/package.json:2:0:
  2 │
    ╵ ^

at failureErrorWithLog (C:\Users\pinke\p\menu-front\node_modules\esbuild\lib\main.js:1651:15)
at C:\Users\pinke\p\menu-front\node_modules\esbuild\lib\main.js:1059:25
at runOnEndCallbacks (C:\Users\pinke\p\menu-front\node_modules\esbuild\lib\main.js:1486:45)
at buildResponseToResult (C:\Users\pinke\p\menu-front\node_modules\esbuild\lib\main.js:1057:7)
at C:\Users\pinke\p\menu-front\node_modules\esbuild\lib\main.js:1069:9
at new Promise (<anonymous>)
at requestCallbacks.on-end (C:\Users\pinke\p\menu-front\node_modules\esbuild\lib\main.js:1068:54)
at handleRequest (C:\Users\pinke\p\menu-front\node_modules\esbuild\lib\main.js:732:17)
at handleIncomingPacket (C:\Users\pinke\p\menu-front\node_modules\esbuild\lib\main.js:757:7)
at Socket.readFromStdout (C:\Users\pinke\p\menu-front\node_modules\esbuild\lib\main.js:680:7)

Validations

stackblitz[bot] commented 7 months ago

Fix this issue in StackBlitz Codeflow Start a new pull request in StackBlitz Codeflow.

github-actions[bot] commented 7 months ago

Hello @houd1ni. Please provide a minimal reproduction using a GitHub repository or StackBlitz. Issues marked with needs reproduction will be closed if they have no activity within 3 days.

houd1ni commented 7 months ago

Hello @houd1ni. Please provide a minimal reproduction using a GitHub repository or StackBlitz. Issues marked with needs reproduction will be closed if they have no activity within 3 days.

Okay. It's easier to move to Rsbuild then.

houd1ni commented 7 months ago

Dunno why marked completed. Reopening then.