Please guys I have been using Netlify for years now and never had this problem.
My Vite react site deployment doesn’t do the post-processing stage, it skips the post-processing.
Then it says the site is live. But when I go to the page, I get a blank page.
The thing is, I have been using Vite and Netlify together for a while now. I already have 3 live websites that were built with Vite and still work perfectly.
I have never faced this problem before and I didn’t do anything different. So I am really perplexed. I have read those docs and followed their instructions which I have always done before.
Its also rather annoying that Netlify cannot even log what the issue is.
Run your build command locally and confirmed the output?
Confirmed the same Build command is set on Netlify?
Confirmed that the correct Publish directory is set on Netlify?
Netlify follows the instructions as provided, if it were given source files and told to “build nothing and deploy them”, then it would “build nothing and deploy them” and there wouldn’t be any errors to log.
Here is the error: “Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of “application/octet-stream”. Strict MIME type checking is enforced for module scripts per HTML spec.”
@Wayskid Yes there is, but that’s not new information.
Refer to my original screenshot where I show that your currently deployed site has a script element with a src attribute pointing to a .jsx file with a type="text/babel".
That error occurs because the site is trying to load that .jsx file as if it were a .js file and Netlify serves the .jsx file with a Content-Type of application/octet-stream.
Oh my God, it worked!
You have literally just saved my life. I’ve been on this for days.
So I did the build locally, then deleted the website on Netlify to start the deployment from scratch.
I put the publish directory as /frontend/dist
And it worked!
Thank you so much Nathan.
My other question is, I didn’t use to do this before and things just worked. Please what changed?
Cause now I need to know if I need to start doing this for other sites I will build going forward.