Website runs well locally, but doesn't work when deployed

Hi,

I recently tried deploying my website. I tried deploying it here, where I got a blank white page with the error “Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of “text/jsx”. Strict MIME type checking is enforced for module scripts per HTML spec”.

These are my build settings:

It works fine when I build it myself and run a preview. I’m not sure if these affect anything but I also got these errors when running the build: “node_modules/three-stdlib/libs/lottie.js (13062:32) Use of eval in “node_modules/three-stdlib/libs/lottie.js” is strongly discouraged as it poses security risks and may cause issues with minification.” and "(!) Some chunks are larger than 500 kB after minification. Consider:

  • Using dynamic import() to code-split the application
  • Use build.rollupOptions.output.manualChunks to improve chunking: Configuration Options | Rollup
  • Adjust chunk size limit for this warning via build.chunkSizeWarningLimit."

My github repo: GitHub - Dragontory/Personal_Portfolio_Website

Any help is appreciated. Thanks!

You haven’t included a URL for the live site to see the error firsthand.

However, looking at the vite.config.js I see one issue: You need to remove the base configuration option

  base: '/vite-deploy-demo/'

When deployed on Netlify, the site sits at the domain root / ergo this option is not required (and will break things.)

I did get rid of that line and tried to deploy it again. I wasn’t able to successfully build it and this error came up:

I’m not sure why the asset had this issue. I also tried to deploy via Github and was met with this error: Failed to load resource: the server responded with a status of 404 () main.jsx:1.

My site name is prismatic-fairy-1d5ec6.

Thanks!

The error is because the file referenced test/python.png does not exist. The file that does exist is tech/Python.png.