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

fix double esbuild-register register #19852

Merged
merged 4 commits into from
Nov 17, 2022

Conversation

ndelangen
Copy link
Member

@ndelangen ndelangen commented Nov 16, 2022

Sometimes the esbuild-register has already happened.

This can be caused by some script having registered it, then calling serverRequire, but it also can happen in unit-tests where modules get re-initialized.

  • I added detection for when there's already a handler for .ts files. If that's the case, skip registering esbuild-register.

This seems like a good enough heuristic, but I'm open to changes.
I was inspired to this solution by looking at the esbuild-register source-code.

@ndelangen ndelangen self-assigned this Nov 16, 2022
@ndelangen ndelangen added the bug label Nov 16, 2022
@ndelangen ndelangen merged commit 0c36f0a into next Nov 17, 2022
@ndelangen ndelangen deleted the fix/server-require-double-esbuildregister branch November 17, 2022 11:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants