Ever deployed a Vue or Nuxt app to Netlify and got a 404 page when you refresh? Yeah what is all that about.
Well if you are working with Vue or ...
For further actions, you may consider blocking this person and/or reporting abuse
Does it work with ServerMiddleware?
I created a serverMiddleware in my Nuxt app that makes this call for example,
/api/fetch?url=<user_submitted_url>
. While it works on Heroku, my app gives me 404 error whenever it tries to make that call.I've tried added
fallback: true
togenerate
in the config with no luck.Do you encounter this before?
Hey, not come across that no. Did you manage to fix t?
Yea. Apparently, these issues aren't related. The serverMiddleware doesn't work on static hosting hence it doesn't work on Netlify. I replaced the serverMiddleware with Netlify functions.
Nice 👏
Thanks ! It's work well !
Thank you so much.
Hey, thank you for the post. would this still work with firebase? I can't seem to find proper documentation for deploying nuxt in spa mode on firebase.
Hey, I have never worked with firebase but I found this article. hope it helps
thank you! yes, it did help.
Hi! Is there a way to fix this with just Vue? I'm not using either Nuxt or Netlify, just plain Vue.js. Would I have to add some kind of fix on the router files? Thank you.
Yes
=> In your public folder
=> create a new file and name it "_redirects"
=> Paste this inside without the quote
"/* /index.html 200"
=> Save your file and push to github
=> It should work this way
hey sorry not too sure. haven't tried it but am sure it will work somehow. maybe just creating the 404 file.
Thank you for this! Your redirects snippet really saved the day for me.
Saved my butt! Thank you :D