I have a _redirects file in my public folder where my index.html file is. In the _redirects file i have this:
/* /index.html 200
The client side routing works when i run my react app locally however when i deploy it using netlify drop the client side routing doesn’t work. I think it is working slightly as I don’t get a 404 but the page is blank when I try an access a URL without navigating there through the website. In the console I also get this message
Uncaught SyntaxError: Unexpected token ‘<’
I think this is what is causing my page not to render but can’t work out why this is coming about?
Any help much appreciated thank you!
You should specify them as Root Relative URLs, so they should begin with /
I’m not sure what you’re working with, as you’ve not said, but if you’re using Vite you may have made precisely the same mistake as this other user:
Who had accidentally set the base in their vite.config.js to ./
Oh, and regarding your index.js file, that one simply doesn’t seem to exist at all.
To confirm that you should run your build command locally, and then check the files it outputs.