Closed huseeiin closed 2 weeks ago
Add unenv
as a dependency, add the nodejs_compat
compatability flag to your pages project, and put this in your config:
import { defineConfig } from "@solidjs/start/config";
import { cloudflare } from "unenv";
export default defineConfig({
server: {
preset: "cloudflare-pages",
unenv: cloudflare,
},
});
I think this will be done as part of the cloudflare preset at some point: https://github.com/unjs/nitro/issues/1943
nodejs_compat
worked! thanks!
Add
unenv
as a dependency, add thenodejs_compat
compatability flag to your pages project, and put this in your config:import { defineConfig } from "@solidjs/start/config"; import { cloudflare } from "unenv"; export default defineConfig({ server: { preset: "cloudflare-pages", unenv: cloudflare, }, });
I think this will be done as part of the cloudflare preset at some point: unjs/nitro#1943
but, without the 404 status code?
Duplicates
Latest version
Current behavior 😯
going to a page that doesn't exist in cloudflare pages shows a blank page with a
Uncaught (in promise) Error: Context is not available
error in the browser consoleExpected behavior 🤔
for
[...404].tsx
to render correctlySteps to reproduce 🕹
Steps:
1.create a solid start project 2.wrangler pages deploy dist 3.go to /page-that-doesnt-exist 4.empty page
Context 🔦
No response
Your environment 🌎
No response