Skip to content

.min.js.map files not excluded in make-pot, causing .min.js to be parsed and leading to memory issues #449

Closed

Description

@vipul0425

Bug Report

Describe the current, buggy behavior

The make-pot command attempts to parse .min.js files even though they are explicitly listed in the excluded patterns (*.min.js). This happens when the corresponding .min.js.map files are present in the same directory.

In --debug mode, the log misleadingly shows that .min.js files are being parsed. However, the actual culprit appears to be the .min.js.map files. This can cause unnecessary processing and even memory exhaustion issues in large codebases with many .min.js and .min.js.map files.

Describe how other contributors can replicate this bug

  • Create a build directory with a .min.js file and its corresponding .min.js.map file.
  • Run the wp i18n make-pot command on the directory with --debug enabled.
  • Observe the debug output showing .min.js being parsed despite being excluded.
  • In larger projects, this may lead to memory exhaustion or long processing times.

Describe what you would expect as the correct outcome

Ideally, .min.js.map files should also be excluded from parsing just like .min.js.
At the very least, the debug output should clearly state when .map files are being parsed, to aid troubleshooting.

Provide a possible solution

Update the exclusion list to also include *.min.js.map or .map.

Provide additional context/Screenshots

Image Image Image

Activity

  1. swissspidy commented on Jul 25, 2025

    @swissspidy
    Member

    Thanks for your report.

    The message is a bit misleading / incorrect. To clarify: wp i18n make-pot parses *.js.map files on purpose to get translations with correct source information. It does not actually parse your .min.js file (again, the message is incorrect). We do not want to exclude .js.map files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions