Troubles to deploy Svelte spa

epiz_32378117

https://www.IngRoy.com

Error Message

Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of “text/css”. Strict MIME type checking is enforced for module scripts per HTML spec.

Other Information

I want to deploy my portfolio I did it with Svelte and styled-components
It’s front-end, I already uploaded all with FileZilla and the page only displays a white screen and the Title on the tab

Hi and welcome to the forum

You cannot have server-side rendering on this hosting (no NodeJS)

so you have only one choice left, which is client-side rendering (browser)

to have that, you need to convert everything into static files (html, css, js)

the browser has no idea how to render something that ends with “.svelte”

in fact, it doesn’t even try to render it at all, it just prints the contents of the file - that’s why you see all white

I think your index.html works, but when it starts loading the rest that should be inside (header, footer, etc) it breaks because main.js gives it such instructions and then leads to .svelte files
with whom he does not know how to handle.

2


help stuff

https://www.reddit.com/r/sveltejs/comments/wj9aag/best_static_site_generator_that_uses_svelte/

6 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.