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 to generate in the config with no luck.
Helping you all learn tech, AI, MCPs and more. International speaker, writer, teacher, open source contributor, AI, MCPs, Agentic workflows, playwright, vue, nuxt, react
Location
Spain
Education
Post Grad in Spanish, Frontend Tech Degree at OpenClassrooms, Fullstack Tech Degree at Treehouse
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.
Helping you all learn tech, AI, MCPs and more. International speaker, writer, teacher, open source contributor, AI, MCPs, Agentic workflows, playwright, vue, nuxt, react
Location
Spain
Education
Post Grad in Spanish, Frontend Tech Degree at OpenClassrooms, Fullstack Tech Degree at Treehouse
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.
I am a Frontend Vue JS developer. I am passionate about open source and I love to breakdown programming concepts in those areas that proves extra difficult for developers.
Helping you all learn tech, AI, MCPs and more. International speaker, writer, teacher, open source contributor, AI, MCPs, Agentic workflows, playwright, vue, nuxt, react
Location
Spain
Education
Post Grad in Spanish, Frontend Tech Degree at OpenClassrooms, Fullstack Tech Degree at Treehouse
Passionate about education, fintech, Python, Javascript, progressive growth, and full-stack development.
Sometimes I write code, sometimes I just write.
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.
Helping you all learn tech, AI, MCPs and more. International speaker, writer, teacher, open source contributor, AI, MCPs, Agentic workflows, playwright, vue, nuxt, react
Location
Spain
Education
Post Grad in Spanish, Frontend Tech Degree at OpenClassrooms, Fullstack Tech Degree at Treehouse
Passionate about education, fintech, Python, Javascript, progressive growth, and full-stack development.
Sometimes I write code, sometimes I just write.
Web developer at Greggs, UK with a proficiency in VueJS, Tailwind, and Storyblok, as well as other frameworks. I'm also passionate about web design, and mobile app development.
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: truetogeneratein 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 👏
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.
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.
Thanks ! It's work well !
Thank you so much.
Saved my butt! Thank you :D