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
Currently running same code in nodejs works while it throws error in bun. If we check for the runtime, the problem goes away.
Example working code:
if(!process.versions.bun){// allows to run same elysia on bun and nodejs// otherwise bun throws readonly error// 78 | globalThis.Bun = ElysiaBun;// TypeError: Attempted to assign to readonly property.awaitimport('@bogeychan/elysia-polyfills/node/index.js');}import{Elysia}from'elysia';constapp=newElysia().get('/',()=>({hello: 'Node.js👋'})).listen(8080);console.log(`Listening on http://localhost:${app.server!.port}`);
It would be awesome if the check was done inside the codebase directly so the polyfill does not trigger in the bun runtime.
The text was updated successfully, but these errors were encountered:
Currently running same code in nodejs works while it throws error in bun. If we check for the runtime, the problem goes away.
Example working code:
It would be awesome if the check was done inside the codebase directly so the polyfill does not trigger in the bun runtime.
The text was updated successfully, but these errors were encountered: