Build/test tools: fix Zod export error in JavaScript linting - #12704
Build/test tools: fix Zod export error in JavaScript linting#12704lancewillett wants to merge 1 commit into
Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
There was a problem hiding this comment.
Pull request overview
This PR addresses a JavaScript linting failure (ERR_PACKAGE_PATH_NOT_EXPORTED for zod/v4/core) after a clean npm ci by forcing the dependency graph to use a Zod version that correctly exports the needed path.
Changes:
- Add an npm
overridesentry to pinzodto3.25.1. - Update
package-lock.jsonto reflect the new resolved Zod version and remove the previously nested Zod copy.
Reviewed changes
Copilot reviewed 1 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| package.json | Adds an npm override to force Zod to 3.25.1 to avoid the export-path error. |
| package-lock.json | Updates lockfile resolutions to Zod 3.25.1 and removes the nested Zod instance under eslint-plugin-react-hooks. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| "overrides": { | ||
| "zod": "3.25.1" | ||
| }, |
Test using WordPress PlaygroundThe changes in this pull request can previewed and tested using a WordPress Playground instance. WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser. Some things to be aware of
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
Pin the smallest Zod release that provides the export required by the JSDoc lint toolchain. Fixes #65723. Props lance.willett@automattic.com
a0bb794 to
e79dbf8
Compare
|
I replicate the issue when running |
mukeshpanchal27
left a comment
There was a problem hiding this comment.
Pre-approved.
npm run lint:jsdoc takes quite a long time in my local environment, but I'm no longer seeing the Error [ERR_PACKAGE_PATH_NOT_EXPORTED] error.
A clean `npm ci` resolves Zod to 3.23.8, so `zod/v4/core` fails with ERR_PACKAGE_PATH_NOT_EXPORTED and breaks the JSDoc lint run. Pin Zod to 3.25.1 with a package.json override and update the lockfile. 3.25.1 is the smallest release that ships the required export with a CommonJS target; 3.25.0 declares the export but omits the CommonJS build. All Zod consumers now resolve to 3.25.1. (Now that's a lotta Zod!) Developed in: #12704 Props mukesh27, adrianmoldovanwp Fixes #65723 git-svn-id: https://develop.svn.wordpress.org/trunk@62861 602fd350-edb4-49c9-b593-d223f7449a82
A clean `npm ci` resolves Zod to 3.23.8, so `zod/v4/core` fails with ERR_PACKAGE_PATH_NOT_EXPORTED and breaks the JSDoc lint run. Pin Zod to 3.25.1 with a package.json override and update the lockfile. 3.25.1 is the smallest release that ships the required export with a CommonJS target; 3.25.0 declares the export but omits the CommonJS build. All Zod consumers now resolve to 3.25.1. (Now that's a lotta Zod!) Developed in: WordPress/wordpress-develop#12704 Props mukesh27, adrianmoldovanwp Fixes #65723 Built from https://develop.svn.wordpress.org/trunk@62861 git-svn-id: http://core.svn.wordpress.org/trunk@62141 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Fixes the
ERR_PACKAGE_PATH_NOT_EXPORTEDerror forzod/v4/coreafter a cleannpm ci.The dependency tree installed Zod 3.23.8. This change overrides Zod to 3.25.1 and updates the
lockfile.
Zod 3.25.0 declares the export but lacks its CommonJS target. Version 3.25.1 is the smallest working release.
Trac ticket: https://core.trac.wordpress.org/ticket/65723
Verification
clean
npm ci.npm run lint:jsdoc.npm run grunt -- jshint.npm run typecheck:js.successfully.