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(server-file): prefix MODULE_NOT_FOUND with ERR_ #9372

Merged
merged 1 commit into from
Nov 2, 2023

Conversation

jtoar
Copy link
Contributor

@jtoar jtoar commented Nov 2, 2023

If you try to await import a module and it can't be found, it turns out Node throws a different error than if you try to require a module and it can't be found:

  • require(mod) -> MODULE_NOT_FOUND
  • await import(mod) -> ERR_MODULE_NOT_FOUND

We used to tranpsile await imports to require. When we stopped doing that, we forgot to change the error codes we were checking.

@jtoar jtoar added the release:fix This PR is a fix label Nov 2, 2023
@jtoar jtoar added this to the next-release-patch milestone Nov 2, 2023
@jtoar jtoar enabled auto-merge (squash) November 2, 2023 19:25
@jtoar jtoar disabled auto-merge November 2, 2023 19:44
@jtoar jtoar merged commit 6d71ed1 into main Nov 2, 2023
30 checks passed
@jtoar jtoar deleted the ds-server-file/fix-realtime-import-try-catch branch November 2, 2023 19:44
jtoar added a commit that referenced this pull request Nov 2, 2023
If you try to `await import` a module and it can't be found, it turns
out Node throws a different error than if you try to `require` a module
and it can't be found:

- `require(mod)` -> `MODULE_NOT_FOUND`
- `await import(mod)` -> `ERR_MODULE_NOT_FOUND`

We used to tranpsile `await import`s to `require`. When we stopped doing
that, we forgot to change the error codes we were checking.
jtoar added a commit that referenced this pull request Nov 3, 2023
If you try to `await import` a module and it can't be found, it turns
out Node throws a different error than if you try to `require` a module
and it can't be found:

- `require(mod)` -> `MODULE_NOT_FOUND`
- `await import(mod)` -> `ERR_MODULE_NOT_FOUND`

We used to tranpsile `await import`s to `require`. When we stopped doing
that, we forgot to change the error codes we were checking.
@jtoar jtoar modified the milestones: next-release-patch, v6.3.3 Nov 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release:fix This PR is a fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant