Bun.serve() complains: TypeError: Expected fetch() to be a function
moogmodularHOBBY
a month ago
$ NODE_ENV=production bun run src/index.tsx
41 | console.error(`Error serving static file ${path}:`, error)
42 | return new Response('Internal server error', { status: 500 })
43 | }
44 | }
45 |
46 | export const server = Bun.serve({
^
TypeError: Expected fetch() to be a function
at /app/apps/web/src/index.tsx:46:27
Bun v1.1.43 (Linux x64)
I have a React app served with bun but it crashes on start. The Bun version seems quite old.
1 Replies
moogmodularHOBBY
a month ago
Figured it out. Prior to 1.2.3 you need to provide a fetch() method.
https://bun.sh/docs/bundler/fullstack
Status changed to Solved brody • about 1 month ago