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: improve module load error handling #996

Merged
merged 1 commit into from
Mar 4, 2024

Conversation

mdonnalley
Copy link
Contributor

@mdonnalley mdonnalley commented Mar 4, 2024

Improve error handling for module load errors by:

  • always printing error.message
  • better naming conventions

Testing

  • oclif generate my-cli (select ESM)
  • ERR_UNKNOWN_FILE_EXTENSION error:
    • NODE_ENV=development bin/run.js hello world --from oclif
  • ERR_MODULE_NOT_FOUND error:
    • add invalid import to compiled code (e.g. import foo from 'bar' in ./dist/commands/hello/world.js)
    • bin/run.js hello world --from oclif

Fixes #986

@W-15161976@

@mdonnalley mdonnalley merged commit 5cec2b2 into main Mar 4, 2024
80 checks passed
@mdonnalley mdonnalley deleted the mdonnalley/module-load-error-handling branch March 4, 2024 23:04
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

Successfully merging this pull request may close these issues.

Feature Request: Better error handling
1 participant