Site is live, but sill blank screen i.e white screen (svelte app)

I deploy to Netlify. It is an existing GitHub repo build on svelte.

I managed to publish the site:

11:58:44 AM: Starting post processing

11:58:44 AM: Post processing done

11:58:44 AM: Site is live

11:59:21 AM: Finished processing build request in 1m33.997954007s

But when I go to the link ( https://crypto-valid-svelte.netlify.app/ ) - it’s just a blank page.

Here’s the repo I’m trying to deploy: https://github.com/aa98-45556443355666/crypto_validator--

Where is my mistake and how should I correct it.

Hi @aa98-45556443355666 :wave:t6: ,

Welcome to the forums! Thanks for asking. Are you still experiencing this issue? Your site can load on my end, but there is no content on the pages if that’s what you are referring to?

yes
There is no content showing on the screen and thats my issue.

Hmm, okay. Is this working locally? This is likely an issue with your code. We don’t debug code as it is outside the scope of support. I will leave the thread open so someone else can take a look. (:

1 Like

Yeah it is working locally but not showing anything when I go to deployed url on netlify.

Hi @aa98-45556443355666 :wave:t6: ,

Can you take a look at this specific part of the deploy log and fix?Netlify App

1 Like

How should I fix it Can you tell me steps for it

@aa98-45556443355666 your package.json should have this declaration:

"type":"module"

Can you check that it is there please? If it isn’t then add it :slightly_smiling_face:

Yeah in “package.json” there is already a declaration of
“type”:“module”

so now what should I do it.

Ah, you haven’t added type="module" to your bundle script in index.html.

This line

A white screen in a Svelte app can be caused by a variety of issues. Some common causes include:

  • Syntax errors in your code: Make sure your code is free of syntax errors by running it through a linter or checking it manually.
  • Missing dependencies: Make sure you have all the necessary dependencies installed and imported in your code.
  • Incorrect component structure: Make sure your component structure is set up correctly and that you are rendering the correct component.

It’s hard to say what could be the exact issue without more information on your code and project setup. I would recommend checking the browser’s developer console for error messages and troubleshoot based on those.

https Docs • Svelte

2 Likes

Hi @redbubbletools :wave:t6: ,

Welcome to the forums! :netliconfetti: I appreciate you providing that insightful. This will help a lot of people who come back to this thread and encounter a similar problem.

Thank you!

Now I have added type=“module” in the script tag but now also problem occurs.

Also in console option of the browser error are occurring:
You can see the errors in the screenshot.

There are several issues and the console even shows all of those. For future reference, you should look up those issues on Google, so you can get faster help with those.

For starters, you’re referencing a JS file as CSS file:

Then, this file:

doesn’t actually exist in your deploy. These are the files in your deploy:

/_redirects
/global.css
/vite.svg
/index.html
/images/wave1.png
/images/wave2.png
/images/facebook-icon.png
/images/linkedin-icon.png
/images/snapchat-icon.png
/images/twitter-icon.png
/images/whatsapp-icon.png
/images/user2.jpg
/images/instagram-icon.png
/images/home.png
/images/home1.png
/images/network.png
/images/service1.png
/images/service2.png
/images/service3.png

You need to make sure the file exists at the path being referenced.

Now I have make sure that the file exists at the path being referenced.
But now also the problem remains same.

Hi @aa98-45556443355666 :wave:t6: Thanks for coming back. I see your site page is still blank. When I inspect this is what I see:

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.

Perhaps you can share your repo and someone can help with your code.

Here is my repository.

I believe your publish directory should be dist and not public. I can see, you’ve deployed only these files:

/_redirects
/global.css
/vite.svg
/index.html