question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TypeError when publishing to Github

See original GitHub issue
  • Version: 3.3.0
  • Target: Mac

I am getting an error when attempting to publish to a Github repo. This is part of the stack trace (let me know if you need more of it):

TypeError: Cannot read property 'url' of null
    at /Users/ben.march/content-manager/node_modules/electron-builder/src/publish/PublishManager.ts:79:8
    at next (native)
From previous event:
    at PublishManager.packager.addAfterPackHandler (/Users/ben.march/content-manager/node_modules/electron-builder/out/publish/PublishManager.js:273:29)
    at default.each.it (/Users/ben.march/content-manager/node_modules/electron-builder/src/packager.ts:376:49)
From previous event:
    at Packager.afterPack (/Users/ben.march/content-manager/node_modules/electron-builder/src/packager.ts:376:28)
    at /Users/ben.march/content-manager/node_modules/electron-builder/src/platformPackager.ts:231:21
    at next (native)
    at tryOnImmediate (timers.js:543:15)
    at processImmediate [as _immediateCallback] (timers.js:523:5)

and here is my publish config:

"build": {
    "asar": false,
    "appId": "org.******.ContentManager",
    "mac": {
      "publish": [{
        "provider": "github",
        "host": "git.*******.org",
        "repo": "*****/content-manager"
      }],
      "category": "public.app-category.utility"
    },
    "dmg": {
      "title": "Content Manager"
    }
  }

I did some debugging and it appears that publishConfigs === [null], so publishConfig === null which is why it is throwing the TypeError.

Thanks, Ben

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:18 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
develarcommented, Feb 28, 2017

@benmarch Error is clear. Since you use Github Enterprise, hosted-git-info cannot parse URL. So, you must explicitly set repo and owner options.

"publish": [{
        "provider": "github",
        "host": "git.*******.org",
        "repo": "*****/content-manager"
        "owner": "OWNER"
      }],
1reaction
benmarchcommented, Feb 9, 2017

To give you a bit more information:

I created a private repo on hosted GH and used the minimum config "publish": [{"provider": "github"}] and that worked.

Then I added the repository field to package.json and it still worked.

Then I added the “repo” option to the publish config and it still worked.

When I changed the repository field in package.json to the GH Enterprise URL (keeping everything else the same) it threw the error.

When I changed the “repo” option to match the GH Enterprise repo it threw the error.

It looks like the repository field takes precedent over the “repo” option, and it has a hard time parsing the GH Enterprise URL.

Hope this helps.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Wrangler publish encountered error: Uncaught TypeError: r ...
Though, when I do wrangler publish, It shows this error Uncaught TypeError: r.readFileSync is not a function Reproduce the bug A list of...
Read more >
Github action error on publish: TypeError: Cannot read ...
I just tried to publish again tonight and ran into this GitHub Action publish error "TypeError: Cannot read property 'replace' of null" Here ......
Read more >
Cannot publish a bot from Bot Framework Composer to Azure ...
Describe the bug I am unable to publish my bot from Composer to Azure. I'm getting: TypeError - Cannot Read property 'AzureSubscriptionId' ...
Read more >
All attributes being published to Pub/Sub must be sent as text ...
pubsub publisher retry settings failing with: TypeError: All attributes being published to Pub/Sub must be sent as text strings. #274.
Read more >
TypeError: Unable to parse package.json #32 - GitHub
Run JS-DevTools/npm-publish@v1 with: token: *** check-version: true registry: https://registry.npmjs.org/ package: package.json tag: latest ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found