Provide own default error page in Fresh
Hello! I'm seeing the following error
Can I provide my own default error page instead of this one to sidestep this error? I tried making such a page at
routes/default_error_page.tsx
, but that didn't work
Something that could be related, but that I'm confused about is that this refers to fresh@1.0.1
when my import_map.json
specifies fresh@1.1.4
Any ideas? Thanks in advance!39 Replies
The error means that in
deno.jsonc
you have set jsx runtime to automatic, but you also have set a pragma on the file. This was the way to do it on the early versions of fresh. Remove the following lines and you’ll be good to go.
Edit: You’re also probably looking for this https://fresh.deno.dev/docs/concepts/error-pagesPerfect, this is exactly what I was looking for. Thanks @jaboolo !
you're welcome! <:cookie_deno:1002977285734932480>
I'm trying to implement that, but I'm still confused — I added a page
routes/_404.tsx
that looks like this
Yet I'm still seeing that when pushing to heroku something appears to be implicitly requiring the default_error_page.tsx:1:1
Note that the fresh versions aren't aligned.
Do you know what might be going on @jaboolo ?
Is your repo public? If not, can you send me your
import_map.json
and deno.jsonc
files?It's private, here you are!
I don't have a deno.jsonc, here's my
deno.json
Are you sure you have deleted all
pragmas
? These are comments at the top of the files, such as
In my own source files yes, although something implicitly seems to be importing this file: https://deno.land/x/fresh@1.0.1/src/server/default_error_page.tsx?source=#L1
There you can see the pragma at the top
Yup, that's the second weird stuff, normally fresh
v1.0.1
shouldnt get importedYeah, I'm confused by that
Is there a way to trace what packages are importing what?
I'm going to check one thing, I can kinda imagine what's causing it
perfect, I appreciate you!
Does it work locally?
Like, is the problem happening when you push and it builds
it works locally, the problem appears to be on push & install