Skip to content

[!] Build issue after update to v4.3.3 #436

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
alimd opened this issue Apr 20, 2025 · 12 comments · Fixed by un-ts/napi-postinstall#8
Closed

[!] Build issue after update to v4.3.3 #436

alimd opened this issue Apr 20, 2025 · 12 comments · Fixed by un-ts/napi-postinstall#8

Comments

@alimd
Copy link

alimd commented Apr 20, 2025

I’m facing an issue with deploying my project because of this package. Could you please fix your last release as soon as possible?

More details from unrs/unrs-resolver#71

@alimd
Copy link
Author

alimd commented Apr 20, 2025

@JounQin You’ve closed this issue, but it’s not fixed yet because you’ve released version 4.3.4 with a new update. I’m still waiting for this update. Thank you.

@alimd
Copy link
Author

alimd commented Apr 20, 2025

About your comment in un-ts/napi-postinstall#9 (comment)

yarn up napi-postinstall
Usage Error: Pattern napi-postinstall doesn't match any packages referenced by any workspace

Because I use eslint-import-resolver-typescript instead of napi-postinstall directly!

@JounQin
Copy link
Collaborator

JounQin commented Apr 20, 2025

@alimd yarn up -R napi-postinstall

@alimd
Copy link
Author

alimd commented Apr 20, 2025

yarn up -R napi-postinstall

yarn up -R napi-postinstall
➤ YN0000: · Yarn 4.9.1
➤ YN0000: ┌ Resolution step
➤ YN0000: └ Completed in 1s 411ms
➤ YN0000: ┌ Post-resolution validation
➤ YN0086: │ Some peer dependencies are incorrectly met by dependencies; run yarn explain peer-requirements for details.
➤ YN0000: └ Completed
➤ YN0000: ┌ Fetch step
➤ YN0000: └ Completed
➤ YN0000: ┌ Link step
➤ YN0000: │ ESM support for PnP uses the experimental loader API and is therefore experimental
➤ YN0007: │ unrs-resolver@npm:1.6.1 must be built because it never has been before or the last one failed
➤ YN0009: │ unrs-resolver@npm:1.6.1 couldn't be built successfully (exit code 1, logs can be found here: /private/var/folders/59/ywrwz02d0jdgckn_y2vrjyj00000gn/T/xfs-b3e2634e/build.log)
➤ YN0000: └ Completed in 0s 217ms
➤ YN0000: · Failed with errors in 1s 825ms

@alimd
Copy link
Author

alimd commented Apr 20, 2025

@JounQin

I’m sorry, but could you please provide a specific reason for your insistence on not releasing v4.3.4? Many people, including myself, are currently experiencing this error.

@JounQin
Copy link
Collaborator

JounQin commented Apr 20, 2025

Because it doesn't have to be upgraded when its dependency upgrades, otherwise the upgrade chain is too long.

Can you share what's error is presented in /private/var/folders/59/ywrwz02d0jdgckn_y2vrjyj00000gn/T/xfs-b3e2634e/build.log?

@alimd
Copy link
Author

alimd commented Apr 20, 2025

Because it doesn't have to be upgraded when it's dependency upgrades, otherwise the upgrade chain is too long.

Can you share what's error is presented in /private/var/folders/59/ywrwz02d0jdgckn_y2vrjyj00000gn/T/xfs-b3e2634e/build.log?

I believe you are not familiar with yarn pnp.
Everyone installing version 4.3.3 in ypnp will encounter this issue.
Okay, I’ll revert to version 4.3.2.
Thank you.

@JounQin
Copy link
Collaborator

JounQin commented Apr 20, 2025

You need provide more information then. I also use yarn P'n'P sometimes.

And also, you can delete the napi-postinstall section in yarn.lock and reinstall, the a fresh new napi-postinstall will be installed.

@alimd
Copy link
Author

alimd commented Apr 20, 2025

Many people squander their time due to a simple error you made, especially when you’re unwilling to rectify it in the proper manner.

You need provide more information then.

yarn why unrs-resolver
├─ eslint-import-resolver-typescript@npm:4.3.3
│  └─ unrs-resolver@npm:1.6.1 (via npm:^1.6.0)
│
└─ eslint-import-resolver-typescript@npm:4.3.3 [b0698]
   └─ unrs-resolver@npm:1.6.1 (via npm:^1.6.0)
rm -rf yarn.lock 
yarn

➤ YN0000: · Yarn 4.9.1
➤ YN0000: ┌ Resolution step
➤ YN0085: │ + @lerna-lite/changed@npm:4.0.0, @lerna-lite/cli@npm:4.0.0, @lerna-lite/diff@npm:4.0.0, @lerna-lite/exec@npm:4.0.0, and 807 more.
➤ YN0000: └ Completed in 11s 961ms
➤ YN0000: ┌ Post-resolution validation
➤ YN0086: │ Some peer dependencies are incorrectly met by dependencies; run yarn explain peer-requirements for details.
➤ YN0000: └ Completed
➤ YN0000: ┌ Fetch step
➤ YN0013: │ 32 packages were added to the project (+ 21.64 MiB).
➤ YN0000: └ Completed in 1s 324ms
➤ YN0000: ┌ Link step
➤ YN0000: │ ESM support for PnP uses the experimental loader API and is therefore experimental
➤ YN0007: │ unrs-resolver@npm:1.6.1 must be built because it never has been before or the last one failed
➤ YN0009: │ unrs-resolver@npm:1.6.1 couldn't be built successfully (exit code 1, logs can be found here: /private/var/folders/59/ywrwz02d0jdgckn_y2vrjyj00000gn/T/xfs-91d4aa1b/build.log)
➤ YN0000: └ Completed in 0s 247ms
➤ YN0000: · Failed with errors in 13s 597ms
cat /private/var/folders/59/ywrwz02d0jdgckn_y2vrjyj00000gn/T/xfs-91d4aa1b/build.log
# This file contains the result of Yarn building a package (unrs-resolver@npm:1.6.1)
# Script name: postinstall

/Volumes/Alwatr/Projects/alwatr-io/nanolib/.pnp.cjs:16860
      Error.captureStackTrace(firstError);
            ^

Error: napi-postinstall tried to access unrs-resolver, but it isn't declared in its dependencies; this makes the require call ambiguous and unsound.

Required package: unrs-resolver (via "unrs-resolver/package.json")
Required by: napi-postinstall@npm:0.1.3 (via /Volumes/Alwatr/DevTools/yarn/berry/cache/napi-postinstall-npm-0.1.3-f13def3bad-10c0.zip/node_modules/napi-postinstall/lib/)

Require stack:
- /Volumes/Alwatr/DevTools/yarn/berry/cache/napi-postinstall-npm-0.1.3-f13def3bad-10c0.zip/node_modules/napi-postinstall/lib/index.js
- /Volumes/Alwatr/DevTools/yarn/berry/cache/napi-postinstall-npm-0.1.3-f13def3bad-10c0.zip/node_modules/napi-postinstall/lib/cli.js
    at require$$0.Module._resolveFilename (/Volumes/Alwatr/Projects/alwatr-io/nanolib/.pnp.cjs:16860:13)
    at Function.<anonymous> (node:internal/modules/cjs/loader:1070:27)
    at require$$0.Module._load (/Volumes/Alwatr/Projects/alwatr-io/nanolib/.pnp.cjs:16751:31)
    at TracingChannel.traceSync (node:diagnostics_channel:322:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:217:24)
    at Module.require (node:internal/modules/cjs/loader:1335:12)
    at require (node:internal/modules/helpers:136:16)
    at checkAndPreparePackage (/Volumes/Alwatr/DevTools/yarn/berry/cache/napi-postinstall-npm-0.1.3-f13def3bad-10c0.zip/node_modules/napi-postinstall/lib/index.js:101:11)
    at Object.<anonymous> (/Volumes/Alwatr/DevTools/yarn/berry/cache/napi-postinstall-npm-0.1.3-f13def3bad-10c0.zip/node_modules/napi-postinstall/lib/cli.js:5:44)
    at Module._compile (node:internal/modules/cjs/loader:1562:14)

Node.js v22.13.1

@alimd
Copy link
Author

alimd commented Apr 20, 2025

For your information

It seems that napi-postinstall (versions 0.1.2 and 0.1.3 were observed causing this) attempts to resolve or require the package.json of the host package (unrs-resolver in this case) during its execution. However, unrs-resolver is not declared as a direct or peer dependency within napi-postinstall's own package.json.

Yarn's strict PnP mode enforces dependency boundaries, and since this access isn't backed by a declared dependency relationship, PnP prevents the resolution, causing the build to fail.

@alimd
Copy link
Author

alimd commented Apr 20, 2025

Becouse of your patch release Im not able to build even by downgrade to 4.3.3! 😢

Damn me, I updated the package in the middle of a project delivery and then came back to report it to you! I should have been working with the same previous version so I wouldn't have gotten caught by you.

@alimd
Copy link
Author

alimd commented Apr 20, 2025

Everyone installing version 4.3.3 in ypnp will encounter this issue.

#438

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

Successfully merging a pull request may close this issue.

2 participants