okwuriki kelechi
okwuriki kelechi

Reputation: 31

Deploy Vue.js app to Apache server

i need some help. I wrote an SPA using VueJs. I ran "npm run build" so i can test my app on my Xampp server. The build generated a "/dist" folder. I changed the index.html in the dist folder to index.php. I tried serving the dist folder with Xampp but it shows a blank page. Please help. I have uploaded the image showing the errors

https://i.sstatic.net/ae7GM.jpg

Upvotes: 3

Views: 24121

Answers (2)

Chidiebere Ezeka
Chidiebere Ezeka

Reputation: 33

dist files can only be served via http, you have to deploy it to your hosting server before you can see the output of your vue app

Upvotes: 0

user2305363
user2305363

Reputation: 157

I had the same issue; a bunch of 404's in my console after running npm run build. Ceejayoz is correct in suggesting you take a look at your network tab to see where the server is expecting to reach the file.

His suggestion tipped me off that my application did not have a base URL set. Vue's docs on this.

After setting the path my app was located at, I reran the build process and it came right up.

Upvotes: 1

Related Questions