New to Netlify and I thought I had things figured out but now I can’t resolve this issue.
I built my site using Sveltekit. Everything is working fine, but when I refresh on a page that is not pre-rendered I get:
Page Not Found
Looks like you’ve followed a broken link or entered a URL that doesn’t exist on this site.
I click “Back to our site” and it takes me back to index.html.
But then when I navigate back to that page and refresh again it doesn’t take me back to index.html it just tries to refresh the current page and it stays on that 404 warning.
My netlify.toml file
[[redirects]]
from = “/*”
to = “/index.html”
status = 200
My _redirects file
/.netlify/functions/sveltekit-render 200
/* /index.html 200
The _redirects file is in my build folder with my html files and the netlify.toml file is in the root folder of my Sveltekit project. But adding these or modifying them doesn’t seem to change anything. I’m manually deploying this at the moment.
It looks like you only have one redirect rule for * /.netlify/functions/sveltekit-render 200 implemented in your latest deploy. Did you remove the /* /index.html 200 redirect? If so, could you add that redirect rule and let us know if it helps?
Oh right I re deployed since I first posted this. Sorry about that. I added the redirect again. I put it first in the file, and it reloads the page with no formatting. Otherwise it doesn’t do anything.
Thank you for the response!
I guess that is from the netlify adapter with Sveltekit. I removed the . And it isn’t giving me the same error in the browser but now I’m getting an error in the console
Failed to load module script: Expected a JavaScript module script
but the server responded with a MIME type of "text/html".
Strict MIME type checking is enforced for module scripts per HTML spec.
Still not quite there, but it’s better than before.