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
import{Elysia}from"elysia";import{describe,it,expect}from"bun:test";describe("Elysia issue",()=>{it("should be a test",async()=>{constelysia=newElysia().onRequest(({ set })=>{set.headers["x-test"]="test";}).get("/","Hello World");constresponse=awaitelysia.handle(newRequest("http://localhost/"));console.log(response)expect(response.status).toBe(200);});});
nativeStaticResponse: false didnt fix it
What is the expected behavior?
No response
What do you see instead?
tests\elysia-issue.test.ts:
3 | ) {
4 | const {handler,handleError,hooks:e, mapResponse,mapCompactResponse,mapEarlyResponse,isNotEmpty,utils:{},error:{InternalServerError,},schema,definitions,ERROR_CODE,ElysiaCustomStatusResponse,}=hooks
5 | const trace=e.trace?.map(x=>typeof x==='function'?x:x.fn)??[]
6 |returnfunctionhandle(c){try{if(isNotEmpty(c.set.headers)||c.set.status!==200||c.set.redirect||c.set.cookie)returnmapResponse(handler.clone(),c.set,c.request)
7 |elsereturnhandler.clone()
8 |}catch(error){return(async()=>{const set=c.set
^
TypeError: undefined is not an object (evaluating 'c.set')
at <anonymous> (file:///Z:/PROJECTS/ts-backend/OPEN-SOURCE/ELYSIA/elysia-connect-middleware/node_modules/elysia/dist/bun/index.js:8:43)
at <anonymous> (file:///Z:/PROJECTS/ts-backend/OPEN-SOURCE/ELYSIA/elysia-connect-middleware/node_modules/elysia/dist/bun/index.js:8:60)
at handle (file:///Z:/PROJECTS/ts-backend/OPEN-SOURCE/ELYSIA/elysia-connect-middleware/node_modules/elysia/dist/bun/index.js:10:35)
at <anonymous> (Z:\PROJECTS\ts-backend\OPEN-SOURCE\ELYSIA\elysia-connect-middleware\node_modules\elysia\src\index.ts:817:17)
at map (file:///Z:/PROJECTS/ts-backend/OPEN-SOURCE/ELYSIA/elysia-connect-middleware/node_modules/elysia/dist/bun/index.js:25:65)
at handle (Z:\PROJECTS\ts-backend\OPEN-SOURCE\ELYSIA\elysia-connect-middleware\node_modules\elysia\src\index.ts:6302:57)
at <anonymous> (Z:\PROJECTS\ts-backend\OPEN-SOURCE\ELYSIA\elysia-connect-middleware\tests\elysia-issue.test.ts:11:33)
at <anonymous> (Z:\PROJECTS\ts-backend\OPEN-SOURCE\ELYSIA\elysia-connect-middleware\tests\elysia-issue.test.ts:5:25)
Additional information
No response
Have you try removing the node_modules and bun.lockb and try again yet?
No response
The text was updated successfully, but these errors were encountered:
What version of Elysia is running?
1.2.25
What platform is your computer?
No response
What steps can reproduce the bug?
nativeStaticResponse: false didnt fix it
What is the expected behavior?
No response
What do you see instead?
Additional information
No response
Have you try removing the
node_modules
andbun.lockb
and try again yet?No response
The text was updated successfully, but these errors were encountered: