-
-
Notifications
You must be signed in to change notification settings - Fork 428
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
What version of Elysia is running?
1.2.25
What platform is your computer?
Microsoft Windows NT 10.0.26100.0 x64
What steps can reproduce the bug?
Im using Elysia@1.2.25 in NodeJS,
I followed the quick start and it broke because of the following error:
elysia@1.2.25_@sinclair+typebox@0.33.22_typescript@5.8.2\node_modules\elysia\dist\cjs\index.js:96
typebox: import_type_system.t.Module({}),
^
TypeError: import_type_system.t.Module is not a function
After removing the node_modules for couple of times it finnaly worked.
Then I tried to get data from content type: application/x-www-form-urlencoded
I read the docs and it says:
By default, Elysia will parse the body with content-type of:
text/plain
application/json
multipart/form-data
application/x-www-form-urlencoded
A workaround was this:
const raw = await request.text();
const form = Object.fromEntries(new URLSearchParams(raw));Then I tried setting two types of cookies access-token and refresh-token which didn't work because when i did cookie["access-token"].set = ... and then the same thing to the refresh token, it only executed for the first setter.
another problem was with another example from the docs
import { Elysia } from 'elysia'
new Elysia()
.get('/', ({ redirect }) => {
return redirect('https://youtu.be/whpVWVWBW4U?&t=8')
})
.get('/custom-status', ({ redirect }) => {
// You can also set custom status to redirect
return redirect('https://youtu.be/whpVWVWBW4U?&t=8', 302)
})
.listen(3000)which gives immutable error instead of redirecting
Thank you!
What is the expected behavior?
No response
What do you see instead?
No response
Additional information
No response
Have you try removing the node_modules and bun.lockb and try again yet?
yes
jilv220kravetsone
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working