#Build Successful but no ui showing

1 messages · Page 1 of 1 (latest)

stark hull
#

So I can run npm run dev and npm run preview these work perfectly fine.
Ive now spent a very long time building my react app and I go to build it by running
npm run build
So it says its output is in the ./dist
I go there and open up the index.html file
its blank in chrome nothing is showing up
Ive researched for hours on how to fix yet nothing has helped.
I'm also using tailwind css.
I would really like some help

index.html

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <link rel="icon" type="image/svg+xml" href="./vite.svg" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Vite + React</title>
    <script type="module" crossorigin src="./assets/index.d4b14d92.js"></script>
    <link rel="stylesheet" href="./assets/index.e09fe536.css">
  </head>
  <body>
    <div id="root"></div>
  </body>
</html>

Thanks,
Cookie

kindred sonnet
#

When you open the html, are you serving it from a url ?

#

You usually won’t open the index.html file directly since it won’t work with cors

#

If it works from preview that is what I would use as a source of truth. Since that will simulate how it would likely be served from a real server

stark hull
#

Ok