Skip to content
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

Cannot install Next.js 9.4.4 with Yarn PnP/Berry: '@ampproject/toolbox-optimizer@npm:2.4.0 Cannot be built' #15476

Closed
mxro opened this issue Jul 25, 2020 · 3 comments
Labels
good first issue Easy to fix issues, good for newcomers

Comments

@mxro
Copy link

mxro commented Jul 25, 2020

Bug report

Describe the bug

On trying to add Next.js dependency, the following error is reported:

➤ YN0000: ┌ Link step
➤ YN0007: │ @ampproject/toolbox-optimizer@npm:2.4.0 [717c6] must be built because it never did before or the last one failed
➤ YN0009: │ @ampproject/toolbox-optimizer@npm:2.4.0 [717c6] couldn't be built successfully (exit code 1, logs can be found here: /private/var/folders/xb/mkvj52yn6f174632nfmgf5f1nfkbf4/T/xfs-7cf27f17/build.log)
➤ YN0009: │ @ampproject/toolbox-optimizer@npm:2.4.0 [717c6] couldn't be built successfully (exit code 1, logs can be found here: /private/var/folders/xb/mkvj52yn6f174632nfmgf5f1nfkbf4/T/xfs-7cf27f17/build.log)
➤ YN0000: └ Completed in 11.37s

The error in the build log is:

Error: @ampproject/toolbox-optimizer tried to access dom-serializer, but it isn't declared in its dependencies; this makes the require call ambiguous and unsound.

Required package: dom-serializer (via "dom-serializer")
Required by: @ampproject/toolbox-optimizer@virtual:717c60bb7e1f18db4fa28a328136d908d2f0be772ac81744071e39e823bce1152cb8cd598e20574dd33c9c21bf4563290d0b9cc940ed521d64045a52208cdc1f#npm:2.4.0 

To Reproduce

Steps to reproduce the behavior, please provide code snippets or a repository:

  1. Configure project to use Yarn 2 / Berry / PnP resolution https://yarnpkg.com/getting-started/install
  2. Run yarn add [email protected] react react-dom
  3. Errors above are reported, Next.js dependency is not installed.

Expected behavior

Next.js dependency can be installed without errors.

System information

  • OS: mac os
  • Version of Next.js: 9.4.4
  • Version of Node.js: 12.18.0

Additional context

There is a workaround. I found the installation works just fine when using [email protected]

@timneutkens timneutkens added the good first issue Easy to fix issues, good for newcomers label Jul 26, 2020
@merceyz
Copy link
Contributor

merceyz commented Jul 31, 2020

Fixed in v9.4.5-canary.3 (#13547)

@mxro
Copy link
Author

mxro commented Aug 8, 2020

Confirming this works in v9.4.5-canary.3. Thank you 👍

@balazsorban44
Copy link
Member

This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@vercel vercel locked as resolved and limited conversation to collaborators Jan 29, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
good first issue Easy to fix issues, good for newcomers
Projects
None yet
Development

No branches or pull requests

4 participants