exhibitionist-digital / ultra

Zero-Legacy Deno/React Suspense SSR Framework
https://ultrajs.dev
MIT License
2.99k stars 66 forks source link

Create script does not render properly after running the build task #187

Closed cdoremus closed 1 year ago

cdoremus commented 1 year ago

When I run the create script and then run deno task build followed by deno task start in the .ultra folder, the application is not properly rendered. This is what the UI looks like: image

It appears that the CSS is not being applied. There are no error messages in the server or browser consoles.

This is what the app's generated HTML looks like:

<html lang="en">

<head>
  <meta charset="utf-8">
  <title>Ultra</title>
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="shortcut icon" href="/favicon.ico">
  <link rel="stylesheet" href="/style.css">
  <script async="" src="https://ga.jspm.io/npm:es-module-shims@1.6.2/dist/es-module-shims.js"
    crossorigin="anonymous"></script>
  <script
    type="importmap">{"imports":{"./client.tsx":"./client.bb3c1a57.js","./src/app.tsx":"./src/app.c3bbf465.js","https://deno.land/":"./vendor/browser/deno.land/","https://esm.sh/":"./vendor/browser/esm.sh/","react/jsx-runtime":"./vendor/browser/esm.sh/stable/react@18.2.0/es2022/jsx-runtime.js","ultra/hydrate.js":"./vendor/browser/deno.land/x/ultra@v2.0.0-beta.13/hydrate.js","react-dom/client":"./vendor/browser/esm.sh/v96/react-dom@18.2.0/es2022/client.js","react":"./vendor/browser/esm.sh/stable/react@18.2.0/es2022/react.js"},"scopes":{"./vendor/browser/deno.land/":{"/x/":"./vendor/browser/deno.land/x/"},"./vendor/browser/esm.sh/":{"/stable/":"./vendor/browser/esm.sh/stable/","/v96/":"./vendor/browser/esm.sh/v96/"}}}</script>
  <script type="text/javascript">globalThis.__ULTRA_ENV = []</script>
  <script
    type="text/javascript">globalThis.__ULTRA_ASSET_MAP = [["/style.css", "/style.80353177.css"], ["/favicon.ico", "/favicon.ba44e104.ico"]]</script>
</head>

<body>
  <main>
    <h1><span></span>__<span></span></h1>
    <p>Welcome to
      <!-- --> <strong>Ultra</strong>. This is a barebones starter for your web app.
    </p>
  </main>
  <script type="module" src="./client.bb3c1a57.js" async=""></script>
</body>

</html>

The app renders perfectly when running deno task dev in the root folder.

mashaal commented 1 year ago

This is directly caused by #171 -- thank you for opening @cdoremus, I will action in the next release

cdoremus commented 1 year ago

Thanks for your quick reply @mashaal. In the meantime, what do you suggest as a workaround?

cdoremus commented 1 year ago

Thanks for the quick fix!

cdoremus commented 1 year ago

Verified that the create script now works as advertised. The build now runs correctly from the .ultra folder: image