Do you have a host set up in your vite config file?
This is mine
server: {
host: true,
port: 3009,
hmr: {host: 'localhost', protocol: 'ws'},
},
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I created a fresh laravel projects using Jetstream Livewire but I'm unable to build the assets.
Running npm run dev or npm run build gives this error
error when starting dev server / error during build::
TypeError: Invalid URL
at new URL (node:internal/url:818:25)
at getAdditionalAllowedHosts (file:///C:/Users/User/Projects/traveler/node_modules/vite/dist/node/chunks/dep-CjorC8P2.js:59194:29)
at resolveConfig (file:///C:/Users/User/Projects/traveler/node_modules/vite/dist/node/chunks/dep-CjorC8P2.js:66549:29)
at async _createServer (file:///C:/Users/User/Projects/traveler/node_modules/vite/dist/node/chunks/dep-CjorC8P2.js:62901:18)
at async CAC.<anonymous> (file:///C:/Users/User/Projects/traveler/node_modules/vite/dist/node/cli.js:736:20)
Node: v22.13.0
NPM: v11.0.0
This is my package.json
{
"private": true,
"type": "module",
"scripts": {
"build": "vite build",
"dev": "vite"
},
"devDependencies": {
"@tailwindcss/forms": "^0.5.7",
"@tailwindcss/typography": "^0.5.10",
"autoprefixer": "^10.4.16",
"axios": "^1.7.4",
"concurrently": "^9.0.1",
"laravel-vite-plugin": "^1.0",
"postcss": "^8.4.32",
"tailwindcss": "^3.4.0",
"vite": "^6.0"
}
}
I deleted the project and installed a new one, and I'm still facing the same error. This is the first time I face such an error.
Please or to participate in this conversation.