Skip to content

TypeError: Cannot read properties of null (reading 'author') #795

Closed

Description

@lockHrt

Affected Packages

pkg:@changesets/changelog-github

Problem

pnpx changeset version command is giving following error:

The following error was encountered while generating changelog entries
We have escaped applying the changesets, and no files should have been affected
🦋  error TypeError: Cannot read properties of null (reading 'author')
🦋  error     at Object.getInfo (project-name\node_modules\.pnpm\@[email protected]\node_modules\@changesets\get-github-info\dist\get-github-info.cjs.dev.js:228:12)
🦋  error     at processTicksAndRejections (node:internal/process/task_queues:96:5)
🦋  error     at async project-name\node_modules\.pnpm\@[email protected]\node_modules\@changesets\changelog-github\dist\changelog-github.cjs.dev.js:122:13
🦋  error     at async Object.getReleaseLine (project-name\node_modules\.pnpm\@[email protected]\node_modules\@changesets\changelog-github\dist\changelog-github.cjs.dev.js:99:19)
🦋  error     at async Promise.all (index 0)
🦋  error     at async generateChangesForVersionTypeMarkdown (project-name\node_modules\.pnpm\@[email protected]\node_modules\@changesets\apply-release-plan\dist\apply-release-plan.cjs.dev.js:188:22)
🦋  error     at async getChangelogEntry (project-name\node_modules\.pnpm\@[email protected]\node_modules\@changesets\apply-release-plan\dist\apply-release-plan.cjs.dev.js:243:109)
🦋  error     at async project-name\node_modules\.pnpm\@[email protected]\node_modules\@changesets\apply-release-plan\dist\apply-release-plan.cjs.dev.js:392:21
🦋  error     at async Promise.all (index 0)
🦋  error     at async Object.applyReleasePlan [as default] (project-name\node_modules\.pnpm\@[email protected]\node_modules\@changesets\apply-release-plan\dist\apply-release-plan.cjs.dev.js:287:31)
 ELIFECYCLE  Command failed with exit code 1.
  • The author field is present in all package.json files.
  • GITHUB_TOKEN is also set as env variable with Github PAT with both read:user and repo:status permissions.
  • config file:
{
 "$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
 "changelog": ["@changesets/changelog-github", { "repo": "another-dev/project-name" }],
 "commit": false,
 "fixed": [],
 "linked": [],
 "access": "restricted",
 "baseBranch": "main",
 "updateInternalDependencies": "patch",
 "ignore": []
}
  • tested v0.4.4 and v0.4.3 both giving same error.
  • System is windows 10 and node v16.14.2
  • pnpx changeset is working fine

Activity

  1. unitario commented on Jun 6, 2022

    @unitario

    Push your commits to origin.

  2. clementcreusat commented on Dec 12, 2022

    @clementcreusat

    Thanks, same error, @unitario your comment helped ;)

  3. grempe commented on Dec 12, 2022

    @grempe

    Same issue. Pushed all commits to origin.

    I am using a Turborepo monorepo setup and attempting to to my first changeset snapshot.

    ❯ npx changeset version --snapshot 2022-12-12-21-01                                                            
    The following error was encountered while generating changelog entries
    We have escaped applying the changesets, and no files should have been affected
    🦋  error TypeError: Cannot read properties of null (reading 'author')
    🦋  error     at Object.getInfo (/Users/glenn/src/github.com/truestamp/truestamp-monorepo/node_modules/.pnpm/@[email protected]/node_modules/@changesets/get-github-info/dist/get-github-info.cjs.dev.js:233:12)
    🦋  error     at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    🦋  error     at async /Users/glenn/src/github.com/truestamp/truestamp-monorepo/node_modules/.pnpm/@[email protected]/node_modules/@changesets/changelog-github/dist/changelog-github.cjs.dev.js:122:13
    🦋  error     at async Object.getReleaseLine (/Users/glenn/src/github.com/truestamp/truestamp-monorepo/node_modules/.pnpm/@[email protected]/node_modules/@changesets/changelog-github/dist/changelog-github.cjs.dev.js:99:19)
    🦋  error     at async Promise.all (index 0)
    🦋  error     at async generateChangesForVersionTypeMarkdown (/Users/glenn/src/github.com/truestamp/truestamp-monorepo/node_modules/.pnpm/@[email protected]/node_modules/@changesets/apply-release-plan/dist/apply-release-plan.cjs.dev.js:188:22)
    🦋  error     at async getChangelogEntry (/Users/glenn/src/github.com/truestamp/truestamp-monorepo/node_modules/.pnpm/@[email protected]/node_modules/@changesets/apply-release-plan/dist/apply-release-plan.cjs.dev.js:243:39)
    🦋  error     at async /Users/glenn/src/github.com/truestamp/truestamp-monorepo/node_modules/.pnpm/@[email protected]/node_modules/@changesets/apply-release-plan/dist/apply-release-plan.cjs.dev.js:410:21
    🦋  error     at async Promise.all (index 0)
    🦋  error     at async Object.applyReleasePlan [as default] (/Users/glenn/src/github.com/truestamp/truestamp-monorepo/node_modules/.pnpm/@[email protected]/node_modules/@changesets/apply-release-plan/dist/apply-release-plan.cjs.dev.js:301:31)
    
  4. dhirajarun commented on Dec 25, 2022

    @dhirajarun

    Hey @grempe did you find any solution?

  5. stormwarning commented on Mar 6, 2023

    @stormwarning

    FWIW, just encountered the same error when the changesets action tried to run. Patching get-github-info with some console.log()s showed that the data for a particular squash commit was null (while data for a subsequent squash was retrieved just fine).

    data: {
    	a0: {
    		a36d415e: null,
    		a867d661: {
        		// commitUrl, associatedPullRequests, author values as expected.
    		}
    	}
    }

    Reverting the offending commit unblocked the workflow and recreating and merging the reverted PR seems to have worked fine. Literally the only difference I can find is that there was an extra space in the initial commit title before the PR number:

    image

    Not sure if that's a red herring or not, but hopefully this helps someone

  6. gr2m commented on May 31, 2023

    @gr2m

    I'm running into the same error and none of the suggestions helped. I deleted the whole repository reset the whole git history. The same error still occurs.

    Patching get-github-info with some console.log()s showed that the data for a particular squash commit was null (while data for a subsequent squash was retrieved just fine).

    @stormwarning How did you add the patches? Did you manage to run the command locally somehow?

    Update: nevermind, I was able to reproduce the error by running node_modules/@changesets/cli/bin.js version locally. In my case the problem was an incorrect configuration. changelog[1].repo was set to the incorrect repository, which is why the commit could not be found.

  7. cseas commented on Jun 4, 2023

    @cseas
    Contributor

    changelog[1].repo was set to the incorrect repository, which is why the commit could not be found.

    Thanks! This was the case for me as well as I copied the config from another project and forgot to update the repo value. The error message is very misleading in identifying this.

  8. toakleaf commented on Jul 11, 2023

    @toakleaf

    If you're running into this the underlying issue is that the permissions needed are more broad than those specified here. It says you only need repo:status and read:user, but I had to broaden the permissions to include everything under repo to get it working.

  9. kandji-joe commented on Jul 28, 2023

    @kandji-joe

    If you're running into this the underlying issue is that the permissions needed are more broad than those specified here. It says you only need repo:status and read:user, but I had to broaden the permissions to include everything under repo to get it working.

    After updating my token to include everything under repo it appears to be working now 👍

  10. alex-page commented on Apr 2, 2024

    @alex-page
    Contributor

    The error message should be handled differently when the repo in the config.json cannot be found. The current error is quite confusing.

  11. Seolhun commented on Sep 10, 2024

    @Seolhun

    I originally set up my repository to use the GitHub private registry, but recently I switched to npm.
    This change affected my changeset command, particularly in the following line from config.json:

    "changelog": ["@changesets/changelog-github", { "repo": "seolhun/root-editor" }]

    I deleted this line, It was reolsved.
    But, I'm not sure it is good solution.

  12. MikeHewett commented on Aug 21, 2025

    @MikeHewett

    I originally set up my repository to use the GitHub private registry, but recently I switched to npm. This change affected my changeset command, particularly in the following line from config.json:

    "changelog": ["@changesets/changelog-github", { "repo": "seolhun/root-editor" }]
    I deleted this line, It was reolsved. But, I'm not sure it is good solution.

    @Seolhun I did a similar thing recently and had to remove this plugin. I think its correct in our scenarios as we're not relying on github to generate changelogs but another method.

    Your guidance helped me out, cheers.

  13. added theissue type on Dec 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions