200-type redirect to React app can't find chunk.js

I’m attempting to replace a particular path of a React app with a redirect to yet another React app. To keep the UX consistent it would be ideal to use a 200-status redirect instead of a 301 so the URL doesn’t show any difference to the user.

I’ve set a redirect rule in the _redirect file like so:

  from = "/pals/join"
  to = "https://deploy-preview-2--pal-signup-web.netlify.app/pals/signup"
  status = 200
  force = true

The redirect executes, but the request doesn’t resolve correctly. I end up with a blank screen and a console message that states:

Refused to execute script from 'https://deploy-preview-505--staging-joinpapa-dotcom.netlify.app/static/js/main.0bbcb0c2.chunk.js' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.

I don’t see this main.xxx.chunk.js in the browser sources, and it looks like it’s trying to pull the file from the wrong domain anyway.

Is there a way to provide enough configuration to make the destination React app load up correctly?
Is there also a way to make react-router handle subsequent renders successfully? The new/destination app is an SPA, so any renders triggered after initial load of the destination site just need to go back to that same index.html, I believe.

Original site:
Redirecting to:

Hi @dminer,

The issue is explained in the docs:

(second to last point in limitations).

Hi hrishikesh,

Thanks for your reply! I tried what you suggested, but I didn’t have any luck. With the <base> tag set like that doc describes (mine is set via the PUBLIC_URL env variable) none of the files will load; there is no static folder in the Sources tab of the client browser.

if I remove the <base> configuration and use the 200-style redirect, we get some of the css and only one of the js files:

I don’t understand what’s going on here yet; thanks for your attention on this.

I’m not seeing the <base> tag in either of those 2 links from the above. Could you show where is it exactly?

I’ve added the tag as described but the resources still won’t load:

<base> tag needs to be a domain, not a relative path. Read here:

Thanks @hrishikesh, I was able to get it working using a domain as the path for the base.