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

Error only in test with circular reference in mikro-orm #6680

Closed
Nisgrak opened this issue Oct 24, 2023 · 1 comment
Closed

Error only in test with circular reference in mikro-orm #6680

Nisgrak opened this issue Oct 24, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@Nisgrak
Copy link

Nisgrak commented Oct 24, 2023

What version of Bun is running?

1.0.7+b0393fba6200d8573f3433fb0af258a0e33ac157

What platform is your computer?

Darwin 23.0.0 arm64 arm

What steps can reproduce the bug?

Create 2 entities (in separate files) and reference each other, one with OneToMany and the other with ManyToOne.

Execute bun test and the error throws

What is the expected behavior?

Execute and work like bun run testor bun run main.tscommands

What do you see instead?

test.spec.ts:
15 |         fieldName: 'id_client',
16 |         nullable: true,
17 |         defaultRaw: `NULL`,
18 |         index: 'id_client',
19 |     })
20 |     user: User;
        ^
ReferenceError: Cannot access uninitialized variable.
      at /Users/enekorg/Proyectos/test/mikro-orm-repro/post.entity.ts:20:4

 0 pass
 1 fail
Ran 1 tests across 1 files. [228.00ms]

Additional information

I provide a reproduction
https://github.com/Nisgrak/mikro-orm-error-bun-circular-references

The actual error is user.entity.ts:13, if you declare with strings (https://mikro-orm.io/docs/next/installation#possible-issues-with-circular-dependencies) it works, but in node works with the circular reference

@Nisgrak Nisgrak added the bug Something isn't working label Oct 24, 2023
@Electroid
Copy link
Contributor

Duplicate of #2927

@Electroid Electroid marked this as a duplicate of #2927 Oct 24, 2023
@Electroid Electroid closed this as not planned Won't fix, can't repro, duplicate, stale Oct 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants