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

[plugin-commonjs] incorrect default value for ignoreTryCatch option #1004

Closed
benmccann opened this issue Sep 27, 2021 · 1 comment
Closed

Comments

@benmccann
Copy link
Contributor

  • Rollup Plugin Name: @rollup/plugin-commonjs
  • Rollup Plugin Version: 20

Expected Behavior

The docs for the ignoreTryCatch option say:

In most cases, where require calls are inside a try-catch clause, they should be left unconverted as it requires an optional dependency that may or may not be installed beside the rolled up package.

Thus, I would would expect the default value to be true since it is the value which exhibits this behavior

Actual Behavior

The default is false. The imported code gets hoisted out of the try/catch and fails at runtime as a result

Additional Information

This is the root cause of node-fetch/fetch-blob#117

@jimmywarting
Copy link

maybe this can be closed now when #1005 is merged?

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

No branches or pull requests

2 participants