Wrong Object
prototype in repl context
#12916
Labels
needs triage
This issue has not been looked into
Object
prototype in repl context
#12916
Is there an existing issue for this?
Current behavior
Hello Nestjs team! 👋
Object
prototype in nestjs repl context seems to diverge from theObject
prototype from main context. See the code sandbox below to see an example.This causes runtime issues in repl especially for libraries (ex: typeorm 0.2.45) which checks for
instanceof Object
at runtime.As described here the issue was confirmed in node.js repl module.
When using
useGlobal: true
in the replstart()
options, it works as expected (solution given here).Minimum reproduction code
https://codesandbox.io/p/devbox/jolly-kapitsa-ynrtcq
Steps to reproduce
From code sandbox
Expected behavior
As described here the issue was confirmed in node'js repl module.
When using
useGlobal: true
in the replstart()
options it works as expected (solution given here).Potential solution: Allowing
node
's replstart
options has a second parameter ofnestjs
'srepl
function would allow users to specify specific options such asuseGlobal
if needed.Package
@nestjs/common
@nestjs/core
@nestjs/microservices
@nestjs/platform-express
@nestjs/platform-fastify
@nestjs/platform-socket.io
@nestjs/platform-ws
@nestjs/testing
@nestjs/websockets
Other package
No response
NestJS version
10.0.0
Packages versions
Node.js version
20.9.0
In which operating systems have you tested?
Other
No response
The text was updated successfully, but these errors were encountered: