Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Console.log crashes node #3001

Closed
Alwinator opened this issue Apr 11, 2022 · 3 comments
Closed

Console.log crashes node #3001

Alwinator opened this issue Apr 11, 2022 · 3 comments

Comments

@Alwinator
Copy link

Alwinator commented Apr 11, 2022

NodeJS Version

v16.13.1

Platform

Linux monster 5.13.0-39-generic #44-Ubuntu SMP Thu Mar 24 15:35:05 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

Subsystem

No response

What steps will reproduce the bug?

https://github.com/Alwinator/automapper-nestjs-inject-bug

How often does it reproduce? Is there a required condition?

Simply start using npm run start:dev

What is the expected behavior?

That the mapped object is printed to console

What do you see instead?

The following exception:

[Nest] 39779  - 04/11/2022, 5:52:12 PM   ERROR [ExceptionHandler] Error: Error: TypeError: Cannot read properties of undefined (reading 'properties')
    at Collection.get property [as property] (/home/alwin/WebStormsProjects/node_modules/@mikro-orm/core/entity/ArrayCollection.js:119:44)
    at Collection.[nodejs.util.inspect.custom] (/home/alwin/WebStormsProjects/node_modules/@mikro-orm/core/entity/ArrayCollection.js:168:55)
    at formatValue (node:internal/util/inspect:763:19)
    at formatProperty (node:internal/util/inspect:1681:11)
    at formatRaw (node:internal/util/inspect:1006:9)
    at formatValue (node:internal/util/inspect:793:10)
    at formatProperty (node:internal/util/inspect:1681:11)
    at formatArray (node:internal/util/inspect:1508:17)
    at formatRaw (node:internal/util/inspect:1003:14)
    at formatValue (node:internal/util/inspect:793:10)
This is caused by either a bug in Node.js or incorrect usage of Node.js internals.
Please open an issue with this stack trace at https://github.com/nodejs/node/issues

    at new NodeError (node:internal/errors:371:5)
    at Function.fail (node:internal/assert:20:9)
    at handleMaxCallStackSize (node:internal/util/inspect:1370:10)
    at formatRaw (node:internal/util/inspect:1013:12)
    at formatValue (node:internal/util/inspect:793:10)
    at formatProperty (node:internal/util/inspect:1681:11)
    at formatArray (node:internal/util/inspect:1508:17)
    at formatRaw (node:internal/util/inspect:1003:14)
    at formatValue (node:internal/util/inspect:793:10)
    at formatProperty (node:internal/util/inspect:1681:11)

Additional information

No response

@B4nan
Copy link
Member

B4nan commented Apr 11, 2022

You need to call MikroORM.init() first before you can work with the entity.

@B4nan B4nan closed this as completed Apr 11, 2022
@Alwinator
Copy link
Author

@B4nan That is embarrassing, sorry for using your time.

@B4nan
Copy link
Member

B4nan commented Apr 11, 2022

No problem, its indeed weird and we should make it throw something more informative probably, will try to do so in some future version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants