antfu-collective/vitesse-lite

Errors in production

electroheadfx opened this issue · 4 comments

I try to build the repo for production with:
npm run build
but no success when I publish the code on a live server (GitHub or my server on apache)
it works in local with npx live-server dist --port=4000 --no-browser

This the repo:
https://github.com/electroheadfx/ARPA3

Page error on github: https://electroheadfx.github.io/ARPA3/
404 error

on my website:
http://efxdesign.fr/working/ARPA3/
I have differents errors:
[Error] Did not parse stylesheet at 'http://efxdesign.fr/assets/index.44fc10bc.css' because non CSS MIME types are not allowed in strict mode.
[Error] TypeError: 'text/html' is not a valid JavaScript MIME type.

Any idea about ?

thanks

it works when I publish in netify: https://619cffa56d486817654ecb33--goofy-shannon-42d245.netlify.app
The setup is only for netify services?

antfu commented

Upgrading unocss should fix it for you

I updated:
devDependencies:

- unocss 0.11.0
+ unocss 0.12.4
- unocss-preset-typography 0.3.0
+ unocss-preset-typography 0.3.0

and npm run build:
I copied result of dist on my server:
http://efxdesign.fr/working/ARPA3

with safari/mac:
[Error] Did not parse stylesheet at 'http://efxdesign.fr/assets/index.1ec66dad.css' because non CSS MIME types are not allowed in strict mode.
[Error] TypeError: 'text/html' is not a valid JavaScript MIME type.
promiseReactionJob

with chrome/mac:
Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "text/html". Strict MIME type checking is enforced for module scripts per HTML spec.
index.99b729fb.js:1 Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "text/html". Strict MIME type checking is enforced for module scripts per HTML spec.

It works in local inside a MAMP server.

Any idea if I should my apache/ubuntu server for MIME?
thanks

antfu commented

Sorry I am not familiar with backend setup, since your local env works, I guess your question is out-of-scope of this project and you will need to figure it out yourself