Closed Mikey-ShenSu closed 1 week ago
^1.0.9
Darwin 23.4.0 arm64 arm
package.json:
{ "next": "14.1.3", "@elysiajs/bearer": "^1.0.2" }
/app/api/[[...slugs]]/route.ts:
import { Elysia, t } from "elysia"; import { bearer } from "@elysiajs/bearer"; const app = new Elysia({ prefix: "/api" }) .use(bearer()) export const GET = app.handle; export const POST = app.handle; export const PUT = app.handle; export const DELETE = app.handle; export type API = typeof app;
Bash:
bun run build bun start
Just by that, you will get the error:
{ "name": "TypeError", "message": "Cannot read properties of undefined (reading 'authorization')" }
Should return API response normally.
No response
Such error would not occur if you are in bun dev
bun dev
Should have been fixed with #623.
If the problem still persists, feel free to reopen the issue. Thanks.
What version of Elysia.JS is running?
^1.0.9
What platform is your computer?
Darwin 23.4.0 arm64 arm
What steps can reproduce the bug?
package.json:
/app/api/[[...slugs]]/route.ts:
Bash:
Just by that, you will get the error:
What is the expected behavior?
Should return API response normally.
What do you see instead?
No response
Additional information
Such error would not occur if you are in
bun dev