Make WordPress Core

Opened 7 months ago

Last modified 7 months ago

#49274 new enhancement

Grunt copy:files should ignore node_modules

Reported by: iandunn Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Build/Test Tools Keywords:
Focuses: Cc:


I've gotten this error several times when run grunt watch, and several others have too:

Maximum call stack size exceeded

It happens because there's a node_modules folder somewhere in src/, and they typically contain too many files for Grunt to handle.

Configuring copy:files to always ignore node_modules folders seems like it'd remove that friction for people.

Attachments (1)

49274.1.diff (567 bytes) - added by iandunn 7 months ago.
Adds node_module ignore to _watch task.

Download all attachments as: .zip

Change History (3)

7 months ago

Adds node_module ignore to _watch task.

#1 @iandunn
7 months ago

49274.1.diff works for me, but could use some more eyes/testing.

  1. Clone several plugins that depend on many NPM packages into src/wp-content/plugins (e.g., gutenberg, yoast, coblocks, etc)
  2. Run npm install in each of their directories
  3. Go up to src and run npm run dev
  4. Change some files in src. If there are enough files inside plugins/**/node_modules, then you'll get this error from the watch task:
Running "_watch" task
Warning: Maximum call stack size exceeded
  1. Cancel the npm run dev task
  2. Apply the patch
  3. Restart npm run dev, and change some files.

This ticket was mentioned in Slack in #core by iandunn. View the logs.

7 months ago

Note: See TracTickets for help on using tickets.