Hi! I recently added source maps to my app build, but they’re not showing up on my site (https://play.worldsellergame.com/). I have a _redirects file that reads as follows:
/* /index.html 200
Since it’s an angular app with html5 mode set, I want users to not need hash routing to navigate. But also, I’m not sure how to modify this to allow source maps to pass through. I can’t seem to find anything when I google around either. Is there a way to do this with the _redirects file? It seems like I might be able to do it if I add a netlify.toml but that might be tricky with my set up (github actions) and I haven’t done that before.
Also, I’ve verified that the source maps are generated and available by downloading the archive of the build, they’re just inaccessible.
Thanks in advance.
This likely doesn’t help, but if there is an issue, I don’t believe the
_redirects are causing it.
The rule that you’ve indicated you have doesn’t have the
! (force) and thus won’t override files that do exist.
Does have a file at this location:
If the redirect rule was interfering you would expect that the contents of the
index.html file would be returned.
Interesting, I saw this in the dev tools and network tab and figured that it was loading index.html (although it only shows a white page for me, but I couldn’t get the full content of the returned value for some reason):
DevTools failed to load source map: Could not load content for https://play.worldsellergame.com/runtime.182a6349f83ba432.js.map: Unexpected token '<', "<!DOCTYPE "... is not valid JSON
If not, that’s even more confusing that it doesn’t load the source maps.
@seiyria With the redirect rule that you have, I would expect that to occur for any file that doesn’t actually exist.
Did you confirm that particular source map file was in the archive?
I’d imagine that source map file doesn’t exist, the redirect rule is being applied, and the contents of the
/index.html file is being returned.
Which can be seen when trying to access that file directly:
You’re probably right. I think I was more focused on the fact that one of them returned an error (and maybe should have, maybe not), rather than checking for the specific ones. I’m still having a bit of trouble getting some tools (Rollbar) to pick them up, but if the source maps are there it should be a matter of time before they get picked up.
Thanks for the help, and for telling me about the rule. I didn’t know that ! would do what you suggested, as I’ve never seen that before.
It’s no problem at all.
The documentation for the shadowing behavior is here: