Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type error when using elysia 0.4.x #2

Closed
Tirke opened this issue Apr 8, 2023 · 2 comments
Closed

Type error when using elysia 0.4.x #2

Tirke opened this issue Apr 8, 2023 · 2 comments

Comments

@Tirke
Copy link

Tirke commented Apr 8, 2023

We can't use this package with elysia 0.4 because of an incompatible returned type :)

@SaltyAom
Copy link
Member

SaltyAom commented Apr 8, 2023

Right, this is a bug in bun install, and has reported in Elysia #29

Deleting node_modules and bun.lockb, and re-installing solve the problem, for some reason.

Additional context:

This might sound weird but while I was able to replicate the error, seems like Bun accidentally installed an experimental channel instead of stable randomly causing the type error.

To verify, can you please go into node_modules/@elysiajs/static, the correct results should be no node_modules folder inside, but if so, can you please go inside the node_modules/@elysiajs/static/node_modules/elysia/package.json and see if the version match your installed version.

If this happens, can you try deleting node_modules, and bun.lockb and reinstall again using bun install, restart your IDE if needed, and see if the problem stills persists?

If the issue still persists, can you please try again with either npm / yarn / pnpm to see if the problem still occurs?

Additionally, I found that, this occurs only when you update from elysia version with plugin installed.

So, suppose you previously has Elysia 0.3.1 installed with @elysiajs/cookie, @elysiajs/static, and @elysiajs/swagger, and then update to Elysia 0.3.2, bun install for some reason, will grab the latest release (regardless of channel) instead of reusing the installed module.

Deleting node_modules and bun.lockb solve the problem, for some reason.

Let me know if this helps solve your problem.

@Tirke
Copy link
Author

Tirke commented Apr 8, 2023

It worked, thanks :)

@Tirke Tirke closed this as completed Apr 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants