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

Lockfile generated by @nx/next:build is invalid #17873

Closed
1 of 4 tasks
ganlhi opened this issue Jun 30, 2023 · 6 comments · Fixed by #18192
Closed
1 of 4 tasks

Lockfile generated by @nx/next:build is invalid #17873

ganlhi opened this issue Jun 30, 2023 · 6 comments · Fixed by #18192
Assignees
Labels
outdated scope: nextjs Issues related to NextJS support for Nx type: bug

Comments

@ganlhi
Copy link

ganlhi commented Jun 30, 2023

Current Behavior

When using Yarn 3 in a Nx workspace, running @nx/next:build with generateLockfile generates a lockfile that contains an empty package name:

"":
  version: 5.1.6
  resolution: "typescript@patch:typescript@npm%3A5.1.6#~builtin<compat/typescript>::version=5.1.6&hash=5da071"
  bin:
    tsc: bin/tsc
    tsserver: bin/tsserver
  checksum: f53bfe97f7c8b2b6d23cf572750d4e7d1e0c5fff1c36d859d0ec84556a827b8785077bc27676bf7e71fae538e517c3ecc0f37e7f593be913d884805d931bc8be
  languageName: node
  linkType: hard

Expected Behavior

The generated lockfile should be valid.

GitHub Repo

https://github.com/ganlhi/nx-next-lockfile-issue

Steps to Reproduce

  1. Run yarn install to install dependencies with Yarn 3
  2. Run nx run my-app:build:production
  3. Look at dist/packages/my-app/yarn.lock

Nx Report

>  NX   Report complete - copy this into the issue template

   Node   : 18.13.0
   OS     : darwin-arm64
   yarn   : 3.6.0

   nx                 : 16.4.1
   @nx/js             : 16.4.1
   @nx/jest           : 16.4.1
   @nx/linter         : 16.4.1
   @nx/workspace      : 16.4.1
   @nx/cypress        : 16.4.1
   @nx/devkit         : 16.4.1
   @nx/eslint-plugin  : 16.4.1
   @nx/next           : 16.4.1
   @nx/react          : 16.4.1
   @nrwl/tao          : 16.4.1
   @nx/web            : 16.4.1
   typescript         : 5.1.6

Failure Logs

No response

Operating System

  • macOS
  • Linux
  • Windows
  • Other (Please specify)

Additional Information

No response

@FrozenPandaz FrozenPandaz added the scope: nextjs Issues related to NextJS support for Nx label Jun 30, 2023
@rosettaroberts-impact
Copy link

I've encountered this issue in a vite based project as well.

@veimox
Copy link
Contributor

veimox commented Jul 12, 2023

Note: this is potentially linked to #17853 rather than being a specific NextJS issue

@rosettaroberts-impact
Copy link

@veimox I tested the example repo on nx 16.5.2. The problem remains. Since #17853 was released as part of 16.5.0, it doesn't fix this specific issue.

@veimox
Copy link
Contributor

veimox commented Jul 24, 2023

@rosettaroberts-impact @ganlhi FYI, i have made #18192 to tackle the issue

@ganlhi
Copy link
Author

ganlhi commented Jul 28, 2023

I saw that, thank you! In the meantime I built a custom executor to fix the file afterwards, but it's not very future proof 😅

@github-actions
Copy link

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 14, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated scope: nextjs Issues related to NextJS support for Nx type: bug
Projects
None yet
5 participants