F
Filament2mo ago
pegos

Cryptic Vite Errors

Problem Running the command vite or bun run dev does not work properly and results in the following error. Error
error when starting dev server:
SyntaxError: Unexpected end of JSON input
at JSON.parse (<anonymous>)
at resolveDevelopmentEnvironmentTld (file:///home/pegos/Work/sites/epi-doorman/node_modules/laravel-vite-plugin/dist/index.js:360:23)
at resolveDevelopmentEnvironmentServerConfig (file:///home/pegos/Work/sites/epi-doorman/node_modules/laravel-vite-plugin/dist/index.js:320:94)
at config (file:///home/pegos/Work/sites/epi-doorman/node_modules/laravel-vite-plugin/dist/index.js:39:50)
at runConfigHook (file:///home/pegos/.bun/install/global/node_modules/vite/dist/node/chunks/dep-BWSbWtLw.js:66720:25)
at async resolveConfig (file:///home/pegos/.bun/install/global/node_modules/vite/dist/node/chunks/dep-BWSbWtLw.js:66169:12)
at async _createServer (file:///home/pegos/.bun/install/global/node_modules/vite/dist/node/chunks/dep-BWSbWtLw.js:62758:18)
at async CAC.<anonymous> (file:///home/pegos/.bun/install/global/node_modules/vite/dist/node/cli.js:735:20)
error when starting dev server:
SyntaxError: Unexpected end of JSON input
at JSON.parse (<anonymous>)
at resolveDevelopmentEnvironmentTld (file:///home/pegos/Work/sites/epi-doorman/node_modules/laravel-vite-plugin/dist/index.js:360:23)
at resolveDevelopmentEnvironmentServerConfig (file:///home/pegos/Work/sites/epi-doorman/node_modules/laravel-vite-plugin/dist/index.js:320:94)
at config (file:///home/pegos/Work/sites/epi-doorman/node_modules/laravel-vite-plugin/dist/index.js:39:50)
at runConfigHook (file:///home/pegos/.bun/install/global/node_modules/vite/dist/node/chunks/dep-BWSbWtLw.js:66720:25)
at async resolveConfig (file:///home/pegos/.bun/install/global/node_modules/vite/dist/node/chunks/dep-BWSbWtLw.js:66169:12)
at async _createServer (file:///home/pegos/.bun/install/global/node_modules/vite/dist/node/chunks/dep-BWSbWtLw.js:62758:18)
at async CAC.<anonymous> (file:///home/pegos/.bun/install/global/node_modules/vite/dist/node/cli.js:735:20)
What I've tried so far 1. Replace bun with npm or pnpm 2. Clearing cache 3. Making a fresh project with just Laravel 4. Checking for possible json syntax errors on the whole folder, everything returns a Syntax OK 5. Restoring a backup of my computer to a previous week, in case anything changed on the background and it broke node. 6. Changing node versions (latest, latest LTS, and 21.1.0)
Solution:
Fix was making a symbolic link
sudo ln -s ~/.valet/ ~/.config/
sudo ln -s ~/.valet/ ~/.config/
...
Jump to solution
3 Replies
toeknee
toeknee2mo ago
npm run build Should build the assets then you run the app from say a herd server for ease.
pegos
pegosOP2mo ago
Build works fine but the dev won't solved
Solution
pegos
pegos2mo ago
Fix was making a symbolic link
sudo ln -s ~/.valet/ ~/.config/
sudo ln -s ~/.valet/ ~/.config/
Want results from more Discord servers?
Add your server