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

Fail to patch lock while when a dependency is depending on a different version of Next.js #65182

Open
mwskwong opened this issue Apr 30, 2024 · 0 comments
Labels
bug Issue was opened via the bug report template. create-next-app Related to our CLI tool for quickly starting a new Next.js application.

Comments

@mwskwong
Copy link

mwskwong commented Apr 30, 2024

Link to the code that reproduces this issue

https://github.com/mwskwong/next-patch-lockfile-fail

To Reproduce

Run next dev or next build and observe the terminal output.

Current vs. Expected behavior

Current

Dependencies are as follow:

Next.js is trying to patch the lock file for the Next.js v14.1.0. It failed to do so, and threw the following error:

 ⚠ Found lockfile missing swc dependencies, patching...
 ⨯ Failed to patch lockfile, please try uninstalling and reinstalling next in this workspace
TypeError: Cannot read properties of undefined (reading 'os')
    at fetchPkgInfo (/node_modules/next/dist/lib/patch-incorrect-lockfile.js:73:25)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Promise.all (index 0)
    at async patchIncorrectLockfile (/node_modules/next/dist/lib/patch-incorrect-lockfile.js:162:26)

Expected

Such error should not be thrown

Provide environment information

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 23.2.0: Wed Nov 15 21:53:18 PST 2023; root:xnu-10002.61.3~2/RELEASE_ARM64_T6000
  Available memory (MB): 16384
  Available CPU cores: 8
Binaries:
  Node: 20.10.0
  npm: 10.2.3
  Yarn: 1.22.19
  pnpm: 8.15.4
Relevant Packages:
  next: 14.3.0-canary.31 // Latest available version is detected (14.3.0-canary.31).
  eslint-config-next: 14.3.0-canary.31
  react: 18.3.1
  react-dom: 18.3.1
  typescript: 5.4.5
Next.js Config:
  output: N/A

Which area(s) are affected? (Select all that apply)

create-next-app

Which stage(s) are affected? (Select all that apply)

next dev (local), next build (local)

Additional context

So far, this doesn't seem to impact the main application, including next dev and next build.

There isn't seem to have any issues on starting the React Email dev server, which is based on Next.js either.

@mwskwong mwskwong added the bug Issue was opened via the bug report template. label Apr 30, 2024
@github-actions github-actions bot added the create-next-app Related to our CLI tool for quickly starting a new Next.js application. label Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue was opened via the bug report template. create-next-app Related to our CLI tool for quickly starting a new Next.js application.
Projects
None yet
Development

No branches or pull requests

1 participant