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

can't publish packages with workspace prefix anymore (TypeError) #3412

Closed
matthias-pichler opened this issue Nov 7, 2022 · 3 comments
Closed

Comments

@matthias-pichler
Copy link

Current Behavior

When running yarn lerna publish I get the following error:

lerna ERR! TypeError: Cannot read properties of undefined (reading 'match')
lerna ERR!     at /builds/warrify/dev-tools/npm-packages/.yarn/cache/@lerna-publish-npm-6.0.2-c07f3cf516-b0fefd107a.zip/node_modules/@lerna/publish/index.js:569:52
lerna ERR! lerna Cannot read properties of undefined (reading 'match')

From the error message I can see that it's this line thats causing it. However I don't know where workspaceSpec would come from.

Expected Behavior

I expect lerna to resolve workspace dependencies as before.

Steps to Reproduce

This issue may not be prioritized if details are not provided to help us reproduce the issue.

Failure Logs / Configuration

lerna.json

{
  "packages": ["packages/*"],
  "version": "independent",
  "command": {
    "publish": {
      "allowBranch": "main",
      "ignoreChanges": [
        "README.md",
        "packages/*/README.md",
        "packages/__template__/**",
        "**/*.spec.ts",
        "**/*.config.js",
        "**/__mocks__/**"
      ],
      "message": "chore(release): publish",
      "registry": "https://gitlab.com/api/v4/projects/xxxxxxx/packages/npm/"
    },
    "changed": {
      "ignoreChanges": [
        "README.md",
        "packages/*/README.md",
        "packages/__template__/**",
        "**/*.spec.ts",
        "**/*.config.js",
        "**/__mocks__/**"
      ]
    },
    "version": {
      "allowBranch": "main",
      "ignoreChanges": [
        "README.md",
        "packages/*/README.md",
        "packages/__template__/**",
        "**/*.spec.ts",
        "**/*.config.js",
        "**/__mocks__/**"
      ]
    }
  },
  "publishConfig": {
    "registry": "https://gitlab.com/api/v4/projects/xxxxxxxxx/packages/npm/"
  },
  "npmClient": "yarn",
  "useWorkspaces": true,
  "changelogPreset": "conventionalcommits"
}

lerna-debug.log

<!-- If you have a `lerna-debug.log` available, please paste it here -->
<!-- Otherwise, feel free to delete this <details> block -->

Environment

lerna notice cli v6.0.2
lerna info versioning independent

 Environment info:

  System:
    OS: Linux 5.15 Ubuntu 20.04.5 LTS (Focal Fossa)
    CPU: (16) x64 AMD EPYC 7B13
  Binaries:
    Node: 16.18.0 - /tmp/xfs-483fd360/node
    Yarn: 3.2.4 - /tmp/xfs-483fd360/yarn
    npm: 8.19.2 - ~/.nvm/versions/node/v16.18.0/bin/npm
  Utilities:
    Git: 2.37.3 - /usr/bin/git
@matthias-pichler
Copy link
Author

@fahslaj
Copy link
Contributor

fahslaj commented Nov 7, 2022

Hi @matthias-pichler-warrify, thank you for reporting this issue. This has since been fixed in Lerna version 6.0.3, which was just released. Please upgrade your Lerna version to 6.0.3 and try again.

@matthias-pichler
Copy link
Author

@fahslaj that seems to have fixed it thanks 👍

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

No branches or pull requests

2 participants