React app not loading on custom domain due to failed module script MIME types

I just added a CNAME via my hosting provider (Google Domains) to link my Glitch React app (https://panoramic-gleaming-attention.glitch.me/) to my website (www.paigecrum.com). My app works fin on the provided Glitch project URL, but I get a blank page when viewing it on my website, with errors in the console about not being able to load ‘@vite/client’ or ‘@react-refresh’ because of a disallowed MIME type (“text/html”). (See below screenshots). My favicon and the title of my webpage loads in the tab, so I know the CNAME forwarding is working properly.

In Firefox Dev Tools:

(Similar error in Chrome DevTools, but it wouldn’t allow me to insert more than 1 image.)

Has anyone experienced this before and know of any fixes? Is there an additional build step that I need to do for my React apps if using a custom domain that I didn’t realize? Really hoping to not have to pull this down and host elsewhere! Loving Glitch. Thanks!

Hi there - when I click on your custom domain there, the app loads fine and without errors for me. It may be your computer’s DNS cache not catching up to where the domain is now pointing, or maybe I’m not on the right page. Also, if you make sure https is in front of www.paigecrum.com do you get the same error?

1 Like

Hi Jenn, thanks for your quick reply. Sorry for the hasty question…I do see it now on both so that must’ve been it. Thank you! I didn’t realize I’d be able to access it with https since I didn’t think I had an SSL certificate for that domain.

1 Like

Ah, yes, if you set up your custom domain through Glitch the SSL cert is handled for you! Glad it’s working, and no need to ever apologize for hasty questions here!

5 Likes

Circling back on this…I’ve noticed this has kept happening intermittently since yesterday. I haven’t adjusted any DNS settings on my end and am still able to see the app at the glitch URL, so not sure what the issue might be.