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

NX: Event loop issue - Code only works when using --inspect-brk setTimeout(() => {}, 1000); resolves the issue #5403

Closed
Jordan-Hall opened this issue Sep 14, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@Jordan-Hall
Copy link

Jordan-Hall commented Sep 14, 2023

What version of Bun is running?

1.0.0+822a00c4d508b54f650933a73ca5f4a3af9a7983
1.0.1+31aec4ebe325982fc0ef27498984b0ad9969162b
1.0.1+6e1472b9f827c62522b8986076201797c0e0eb16

What platform is your computer?

Linux 6.1.0-11-amd64 x86_64 unknown

What steps can reproduce the bug?

Repo: https://github.com/Jordan-Hall/nx-bun-template

Command:
bun ./node_modules/nx/bin/nx.js run server:serve

  • fails
  • no logs just crashes out

Command:
bun --inspect-brk ./node_modules/nx/bin/nx.js run server:serve

  • WORKS
  • runs in bun environment

Command:
npx nx run server:serve

  • works
  • node environment

What is the expected behavior?

Either completely broken or completely working

What do you see instead?

image

Additional information

No response

@Jordan-Hall Jordan-Hall added the bug Something isn't working label Sep 14, 2023
@Jordan-Hall Jordan-Hall changed the title Code only works when using --inspect-brk NX: Code only works when using --inspect-brk Sep 14, 2023
@Jordan-Hall
Copy link
Author

Looks like event loop issue is back. timer at top of the file in nx.js fix the issue

@Electroid Electroid added the debugger Something to do with `bun --inspect` or the debugger label Sep 14, 2023
@Jordan-Hall
Copy link
Author

@Electroid Its not a debug issue. I've discovered its actually an event loop issue sorry. Its the ONLY thing blocking NX now

Adding setTimeout(() => {}, 1000); in nx resolves the issue.

@Jordan-Hall Jordan-Hall changed the title NX: Code only works when using --inspect-brk NX: Event loop issue - Code only works when using --inspect-brk setTimeout(() => {}, 1000); resolves the issue Sep 14, 2023
@robobun robobun changed the title NX: Event loop issue - Code only works when using --inspect-brk setTimeout(() => {}, 1000); resolves the issue NX: Event loop issue - Code only works when using --inspect-brk setTimeout(() => {}, 1000); resolves the issue Sep 14, 2023
@Electroid Electroid removed the debugger Something to do with `bun --inspect` or the debugger label Sep 14, 2023
@Jordan-Hall
Copy link
Author

1.0.2 resolves this.

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