Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

kevink2k19's avatar

Vite is not working properly on hosting server

Vite is not working on hosting server. I run command "npm run build" but it's not working after I upload my project online. It is just loading https:://[::1]:5173 instead of website url. What should I?

0 likes
4 replies
martinbean's avatar

@kevink2k19 Define “not working”.

Running npm run build should create static assets within your public/build directory. Seeing https:://[::1]:5173 suggests you’re running npm run dev instead.

1 like
kevink2k19's avatar

@martinbean No. I mean it's loading in head tag of my website. So I change every code that link css and js file maually.

martinbean's avatar

@kevink2k19 You should not be changing URLs manually. All you need to do is use the @vite directive and reference the entry points of the files you want. The actual URL will be looked up in the Vite manifest file and injected in to your web page.

1 like

Please or to participate in this conversation.