You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
.get("/favicon.ico",()=>file("src/assets/images/favicon.ico"),{response: t.File({description: "Returns a logo for the API to display in browsers.",}),})
What is the expected behavior?
No typescript or runtime errors.
What do you see instead?
Typescript outputs the following error, among others:
...
Type 'ElysiaFile' is not assignable to type 'Response | File | BunFile'.
...
Ignoring the type error and trying to access the route at runtime anyways returns this json:
I've been enjoying the development experience with Elysia lately, especially with the efforts you've been making to add wrappers around Bun and Node to maintain a runtime independence.
It struck me as odd that there was no open issue for this problem, I tried searching hard for a while before opening this. The official Elysia docs already use the file() wrapper the framework provides so I'm surprised no one has ran into this case yet.
I understand Node support is not a priority, if this qualifies as that, but hopefully the t.File() type can be easily updated to include the wrapper as I personally prefer not relying on runtime syntax as a best practice. Which I try to do whenever possible with a framework that provides as much out of the box as Elysia does.
Have you try removing the node_modules and bun.lockb and try again yet?
👍
The text was updated successfully, but these errors were encountered:
What version of Elysia is running?
1.2.10
What platform is your computer?
Microsoft Windows NT 10.0.22631.0 x64
What steps can reproduce the bug?
Create a simple GET request for a file:
What is the expected behavior?
No typescript or runtime errors.
What do you see instead?
Typescript outputs the following error, among others:
Ignoring the type error and trying to access the route at runtime anyways returns this json:
Additional information
I've been enjoying the development experience with Elysia lately, especially with the efforts you've been making to add wrappers around Bun and Node to maintain a runtime independence.
It struck me as odd that there was no open issue for this problem, I tried searching hard for a while before opening this. The official Elysia docs already use the
file()
wrapper the framework provides so I'm surprised no one has ran into this case yet.I understand Node support is not a priority, if this qualifies as that, but hopefully the
t.File()
type can be easily updated to include the wrapper as I personally prefer not relying on runtime syntax as a best practice. Which I try to do whenever possible with a framework that provides as much out of the box as Elysia does.Have you try removing the
node_modules
andbun.lockb
and try again yet?👍
The text was updated successfully, but these errors were encountered: