Skip to content

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

Closed

Description

@benmccann
  • 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

Activity

  1. jimmywarting commented on Oct 1, 2021

    @jimmywarting

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions