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
// Include the server in your fileconstserver=require('server');const{ get, post }=server.router;// Handle requests to the url "/" ( http://localhost:3000/ )server([get('/',ctx=>'Hello world!')]);
bun index.ts
What is the expected behavior?
file is excuted, and http://localhost:3000/ will provide a Hello world!
TypeError: Attempted to assign to readonly property.
at assign (native)
at context (/Users/admin/repos/serverjs-test/node_modules/server/server.js:14:44)
at <anonymous> (/Users/admin/repos/serverjs-test/node_modules/server/server.js:64:39)
at handle (/Users/admin/repos/serverjs-test/node_modules/express/lib/router/layer.js:94:21)
at trim_prefix (/Users/admin/repos/serverjs-test/node_modules/express/lib/router/index.js:327:41)
at <anonymous> (/Users/admin/repos/serverjs-test/node_modules/express/lib/router/index.js:288:13)
at process_params (/Users/admin/repos/serverjs-test/node_modules/express/lib/router/index.js:349:6)
at next (/Users/admin/repos/serverjs-test/node_modules/express/lib/router/index.js:280:10)
at expressInit (/Users/admin/repos/serverjs-test/node_modules/express/lib/middleware/init.js:39:9)
at handle (/Users/admin/repos/serverjs-test/node_modules/express/lib/router/layer.js:94:21)
at trim_prefix (/Users/admin/repos/serverjs-test/node_modules/express/lib/router/index.js:327:41)
at <anonymous> (/Users/admin/repos/serverjs-test/node_modules/express/lib/router/index.js:288:13)
at process_params (/Users/admin/repos/serverjs-test/node_modules/express/lib/router/index.js:349:6)
at next (/Users/admin/repos/serverjs-test/node_modules/express/lib/router/index.js:280:10)
at query (/Users/admin/repos/serverjs-test/node_modules/express/lib/middleware/query.js:44:9)
at handle (/Users/admin/repos/serverjs-test/node_modules/express/lib/router/layer.js:94:21)
at trim_prefix (/Users/admin/repos/serverjs-test/node_modules/express/lib/router/index.js:327:41)
at <anonymous> (/Users/admin/repos/serverjs-test/node_modules/express/lib/router/index.js:288:13)
at process_params (/Users/admin/repos/serverjs-test/node_modules/express/lib/router/index.js:349:6)
at next (/Users/admin/repos/serverjs-test/node_modules/express/lib/router/index.js:280:10)
at handle (/Users/admin/repos/serverjs-test/node_modules/express/lib/router/index.js:176:21)
at handle (/Users/admin/repos/serverjs-test/node_modules/express/lib/application.js:180:30)
at app (/Users/admin/repos/serverjs-test/node_modules/express/lib/express.js:38:29)
at <anonymous> (/Users/admin/repos/serverjs-test/node_modules/engine.io/build/server.js:667:54)
at <anonymous> (/Users/admin/repos/serverjs-test/node_modules/socket.io/dist/index.js:327:9)
at emit (node:events:1:2163)
at fetch (node:http:1:9940)
server.js - Website - github
What version of Bun is running?
0.7.4+78defe7a87226b5b10766e24fae458a62811dab2
What platform is your computer?
Darwin 22.5.0 arm64 arm
What steps can reproduce the bug?
bun init
bun add server
bun index.ts
What is the expected behavior?
file is excuted, and
http://localhost:3000/
will provide aHello world!
What do you see instead?
Go to http://localhost:3000/ and see:
Additional information
Related to #3955 (comment)
The text was updated successfully, but these errors were encountered: