Found a fix for showing blank or white screen index.html after running build #3916
Unanswered
jmgb27
asked this question in
Troubleshooting
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have encountered a problem with the build file showing this error in the console.

After searching and troubleshooting for many hours I found a fix. Most of them found a solution by putting a
<base href=".">
in the head section of index.html, and some found a solution by putting a"homepage": "."
inside the package.json file.Here is how i have done it:

I put "." before the the first forward slash in the
src="/dist/index.js"
and also in myhref="/global.css"
Now you might think that everything works fine now, but we have one more problem, the images are not loading.
Here is the fix for the images not loading:
inside the
snowpack.config.mjs
file, I addedbaseUrl: "."
inside buildOptions.Now rebuild your project by typing
npm run build
in the terminal and hope everything should work.Beta Was this translation helpful? Give feedback.
All reactions