exhibitionist-digital / ultra

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

https://ultrajs.dev on Safari is broken #245

Closed richardPFisk closed 1 year ago

richardPFisk commented 1 year ago
image image image

I have been enjoying UltraJS, thanks for creating it. I noticed on my website and on the UltraJS website, that there are errors (see the image above). I haven't found the root cause yet, and I'll share my findings if I make progress. It appears that es-module-shims has a problem.

richardPFisk commented 1 year ago

Closing it as the code below works:

await createServer({
  importMapPath: import.meta.resolve("./importMap.json"),
  browserEntrypoint: import.meta.resolve("./client.tsx"),
  enableEsModuleShims: true,
  esModuleShimsPath:
    "https://ga.jspm.io/npm:es-module-shims@1.7.0/dist/es-module-shims.js",
});

Setting enableEsModuleShims as true for Safari: await server.render(<ServerApp context={context} />, { enableEsModuleShims: true })

Using un-configured render for Chrome: await server.render(<ServerApp context={context} />)

richardPFisk commented 1 year ago

Note: the error TypeError: Module specifier, 'react/jsx-runtime' does not start with "/", "./", or "../". Referenced from still occurs but the client code runs.