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

Failing at basic multirepo use #1335

Open
martypdx opened this issue Mar 27, 2024 · 3 comments
Open

Failing at basic multirepo use #1335

martypdx opened this issue Mar 27, 2024 · 3 comments

Comments

@martypdx
Copy link

Trying to add changesets in a pnpm monorepo. I did:

> pnpm add -D @changesets/cli
> pnpm changesets init
> pnpm changesets

But it only wants to publish the root package.json (which is just the monrepo root, not a package), which is set to private: true.

Everything suggests changesets is meant to thrive in multi-package repos. So what I am I missing?

@altano
Copy link

altano commented Apr 1, 2024

You probably have a version in your package.json. changesets will try to version anything with a version, even private packages, unless you set the "privatePackages": false option in your config.json, which would cause it to ignore private packages regardless of the presence of a version.

@martypdx
Copy link
Author

martypdx commented Apr 2, 2024

@altano trying any of those options causes this error:

📂 azoth 🚀 pnpm changeset
🦋  error TypeError: Cannot read properties of undefined (reading 'packageJson')
🦋  error     at createChangeset (/Users/marty/dev/azothjs/azoth/node_modules/.pnpm/@changesets+cli@2.27.1/node_modules/@changesets/cli/dist/changesets-cli.cjs.js:392:75)
🦋  error     at add (/Users/marty/dev/azothjs/azoth/node_modules/.pnpm/@changesets+cli@2.27.1/node_modules/@changesets/cli/dist/changesets-cli.cjs.js:506:26)
🦋  error     at async run (/Users/marty/dev/azothjs/azoth/node_modules/.pnpm/@changesets+cli@2.27.1/node_modules/@changesets/cli/dist/changesets-cli.cjs.js:1304:5)
📂 azoth 🚀 pnpm changeset
🦋  error TypeError: Cannot read properties of undefined (reading 'packageJson')
🦋  error     at createChangeset (/Users/marty/dev/azothjs/azoth/node_modules/.pnpm/@changesets+cli@2.27.1/node_modules/@changesets/cli/dist/changesets-cli.cjs.js:392:75)
🦋  error     at add (/Users/marty/dev/azothjs/azoth/node_modules/.pnpm/@changesets+cli@2.27.1/node_modules/@changesets/cli/dist/changesets-cli.cjs.js:506:26)
🦋  error     at async run (/Users/marty/dev/azothjs/azoth/node_modules/.pnpm/@changesets+cli@2.27.1/node_modules/@changesets/cli/dist/changesets-cli.cjs.js:1304:5)

I spent a little time debugging, but it goes through a lot of node/babel polyfill code and is hard to do so from the dist module. But it looks like it is only finding one package initially, then failing when it gets here.

@altano
Copy link

altano commented Apr 2, 2024

@martypdx if you post a repro on stackblitz I’ll try to help.

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

No branches or pull requests

2 participants