[wp-trac] [WordPress Trac] #62839: sync-gutenberg-packages script is not respecting .npmrc file

WordPress Trac noreply at wordpress.org
Wed Apr 2 00:43:23 UTC 2025


#62839: sync-gutenberg-packages script is not respecting .npmrc file
-------------------------------------------------+-------------------------
 Reporter:  desrosj                              |       Owner:  (none)
     Type:  defect (bug)                         |      Status:  new
 Priority:  normal                               |   Milestone:  6.9
Component:  Build/Test Tools                     |     Version:
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch needs-testing-info         |     Focuses:
  reporter-feedback                              |
-------------------------------------------------+-------------------------
Changes (by SirLouen):

 * keywords:  has-patch needs-testing => has-patch needs-testing-info
     reporter-feedback


Comment:

 == Combined Issue Reproduction and Test Report
 === Description
 🟠 This report can't validate much about this whole issue

 Patch tested: https://github.com/WordPress/wordpress-
 develop/pull/8431.diff

 === Environment
 - WordPress: 6.9-alpha-60093-src
 - PHP: 8.2.28
 - Server: nginx/1.27.4
 - Database: mysqli (Server: 8.0.41 / Client: mysqlnd 8.2.28)
 - Browser: Chrome 134.0.0.0
 - OS: Windows 10/11
 - Theme: Twenty Twenty-Five 1.1
 - Plugins:
   * Test Reports 1.2.0

 === Reproduction Steps

 1. Run `npm dedupe --verbose` (without verbosity, you cannot see if it
 gets stuck at some point), I can't see any changes after this.
 2. ❌ Run `npm run sync-gutenberg-packages`. File changes, but I can't
 confirm any duplicates.
 3. 🐞 Can confirm the TypeError during `sync-gutenberg-packages`
 4. ❌ After each `dedupe` I can't confirm any new changes in `package-
 lock.json`. I can't confirm any duplicates either.

 === Expected
 - Given the absence of duplicates, I'm not 100% sure what to expect
 - The error is gone

 === Actual Results with the Patch
 1. ✅ The error is gone with the patch.
 2. 🟠 No real impact done by this patch, I can't see a single difference
 between `package-lock.json` before and after the patch.

 === Additional Notes
 According to the patch creator:
 > This is due to the fact that in generated package-lock.json file,
 dependencies are not a top level property/field, rather it is nested
 inside packages i.e each package. As a result, packageLock.dependencies is
 undefined. This needs some more investigation so I am hoping to raise a
 separate PR for that

 Given that I can't reproduce the original issue (duplication of packages),
 I would suggest that @desrosj does a double check to see what is going on.
 Also, it would be great to get additional information and thoughts from
 `jtquip88`, as I'm not really sure how is affecting both the error and the
 patched version.

 I think that if we just wanted to wipe the error, something as minimal as
 this:

 {{{
 const versionConflicts = Object.entries(packageLock.dependencies || {});
 }}}

 Would have done the trick as well.

 PS: It's a pain to test this, it takes one year to run all the processes.

 === Supplemental Artifacts

 This is the full error:
 {{{
 TypeError: Cannot convert undefined or null to object
 at Function.entries (<anonymous>)
 at getMismatchedNonWordPressDependencies (/home/admin/src/wordpress
 /wordpress-develop/tools/release/sync-gutenberg-packages.js:110:34)
 at main (/home/admin/src/wordpress/wordpress-develop/tools/release/sync-
 gutenberg-packages.js:36:28)
 at Object.<anonymous> (/home/admin/src/wordpress/wordpress-
 develop/tools/release/sync-gutenberg-packages.js:225:1)
 at Module._compile (node:internal/modules/cjs/loader:1469:14)
 at Module._extensions..js (node:internal/modules/cjs/loader:1548:10)
 at Module.load (node:internal/modules/cjs/loader:1288:32)
 at Module._load (node:internal/modules/cjs/loader:1104:12)
 at Function.executeUserEntryPoint [as runMain]
 (node:internal/modules/run_main:174:12)
 at node:internal/main/run_main_module:28:49
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/62839#comment:5>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list