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

@netlify/build-info throws EDUPLICATEWORKSPACE even with pnpm #4848

Closed
sapphi-red opened this issue Feb 2, 2023 · 1 comment
Closed

@netlify/build-info throws EDUPLICATEWORKSPACE even with pnpm #4848

sapphi-red opened this issue Feb 2, 2023 · 1 comment
Assignees
Labels
type: bug code to address defects in shipped code

Comments

@sapphi-red
Copy link

Describe the bug

getBuildInfo function in @netlify/build-info throws EDUPLICATEWORKSPACE when there is a duplicated workspace names.
Duplicated workspace names are not allowed by npm and yarn.
But it is supported by pnpm (pnpm/pnpm#5957).

I expect getBuildInfo function not to throw an error.

Steps to reproduce

  1. Clone https://github.com/sapphi-red-repros/netlify-pnpm-cannot-iterate-over-repro
  2. git switch build-info
  3. pnpm i
  4. node index.mjs

Configuration

[build.environment]
  NODE_VERSION = "16"
[build]
  publish = "packages/foo/.vitepress/dist"
  command = "pnpm build-foo"

Deploy logs

https://app.netlify.com/sites/dashing-marzipan-db6e0f/deploys/63ca28d308f3e100098fe2eb#L30

Here is the log, but it does not output any information that indicates that the error I described occurred. (netlify/build-image#898).

@sapphi-red sapphi-red added the type: bug code to address defects in shipped code label Feb 2, 2023
@lukasholzer
Copy link
Contributor

It's fixed in a newer version (but this package is not ment to be used outside netlify)
The function getBuildInfo is currently not exported in version 6.5.0.

But you can call it via the CLI binary:

➜  netlify-pnpm-cannot-iterate-over-repro git:(build-info) ✗ pnpx @netlify/build-info
{
  "packageManager": {
    "name": "pnpm",
    "installCommand": "pnpm install",
    "runCommand": "pnpm run",
    "lockFile": "pnpm-lock.yaml",
    "forceEnvironment": "NETLIFY_USE_PNPM"
  },
  "jsWorkspaces": {
    "rootDir": "/Users/lukasholzer/Sites/monorepos/netlify-pnpm-cannot-iterate-over-repro",
    "isRoot": true,
    "packages": [
      "packages/bar1/duplicated",
      "packages/bar2/duplicated",
      "packages/foo"
    ]
  },
  "frameworks": [],
  "buildSystems": []
}

@lukasholzer lukasholzer self-assigned this Mar 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug code to address defects in shipped code
Projects
None yet
Development

No branches or pull requests

2 participants