Visitar URL original
[5.107.1 regression] The functions exported by CommonJS through exports are wrongly marked as unused and are lost on the exports. · Issue #21178 · webpack/webpack · GitHub
Skip to content

[5.107.1 regression] The functions exported by CommonJS through exports are wrongly marked as unused and are lost on the exports. #21178

Closed

Description

@ShenHongFei

Have you used AI?

No

Bug Description

source

Image

output

Image

before version 5.107.1, for example 5.107.0

Image

related pr

maybe #21003

Link to Minimal Reproduction and step to reproduce

packing npm package ali-oss

Expected Behavior

run normally

Actual Behavior

TypeError: this.buildCanonicalizedResource is not a function

Environment

Both webpack 5.107.1 and 5.107.2 have this problem.

Is this a regression?

Yes (please specify version below)

Last Working Version

5.107.0

Additional Context

No response

Activity

  1. ShenHongFei commented on Jun 12, 2026

    @ShenHongFei
    ContributorAuthor

    It is difficult to analyze which of the exported items are actually not being used in exports. It is not recommended to perform tree shaking.
    e.g. let e = exports; e[str + str2].method()

  2. added 6 commits that reference this issue on Jun 12, 2026
    b866bc6
    1ebf094
    f835398
    98273e5
    edbe1ef
    a572761
  3. added a commit that references this issue on Jun 15, 2026
    c13cf1e
  4. added a commit that references this issue on Jul 10, 2026
    ccb40c8
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

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions