forge: Publishing to github fails due to deprecated options in @octokit/rest.js

  • I have read the contribution documentation for this project.
  • I agree to follow the code of conduct that this project follows, as appropriate.
  • I have searched the issue tracker for an issue that matches the one I want to file, without success.

Please describe your issue:

Using v5.2.0, attempting to publish to github releases. Seems like the github api host (api.github.com) is undefined for some reason. Possibly an issue with octokit

Console output when you run electron-forge with the environment variable DEBUG=electron-forge:*. (Instructions on how to do so here). Please include the stack trace if one exists.

josh:gif-goat pixelfiend$ DEBUG=electron-forge:* electron-forge publish
WARNING: DEBUG environment variable detected.  Progress indicators will be sent over electron-forge:lifecycle
  electron-forge:lifecycle Process Started: Checking your system +0ms
  electron-forge:lifecycle Process Succeeded: Checking your system +1s
  electron-forge:runtime-config setting key: verbose to value: false +0ms
WARNING: DEBUG environment variable detected.  Progress indicators will be sent over electron-forge:lifecycle
  electron-forge:publish triggering make +0ms
  electron-forge:lifecycle Process Started: Resolving Forge Config +0ms
  electron-forge:project-resolver searching for project in: /Users/pixelfiend/workspace/gif-goat +0ms
  electron-forge:project-resolver electron-forge compatible package.json found in /Users/pixelfiend/workspace/gif-goat/package.json +1ms
  electron-forge:lifecycle Process Succeeded: Resolving Forge Config +8ms
  electron-forge:require-search searching [ '../makers/darwin/dmg.js',
  '../makers/generic/dmg.js',
  'electron-forge-maker-dmg',
  'dmg',
  '/Users/pixelfiend/workspace/gif-goat/dmg',
  '/Users/pixelfiend/workspace/gif-goat/node_modules/dmg',
  '/Users/pixelfiend/.nvm/versions/node/v6.14.1/lib/node_modules/electron-forge/dist/makers/darwin/dmg.js',
  '/Users/pixelfiend/.nvm/versions/node/v6.14.1/lib/node_modules/electron-forge/dist/makers/generic/dmg.js',
  '/Users/pixelfiend/.nvm/versions/node/v6.14.1/lib/node_modules/electron-forge/dist/api/electron-forge-maker-dmg',
  '/Users/pixelfiend/.nvm/versions/node/v6.14.1/lib/node_modules/electron-forge/dist/api/dmg',
  '/Users/pixelfiend/workspace/gif-goat/dmg',
  '/Users/pixelfiend/workspace/gif-goat/node_modules/dmg',
  '/Users/pixelfiend/.nvm/versions/node/v6.14.1/lib/node_modules/electron-forge/dist/api/makers/darwin/dmg.js',
  '/Users/pixelfiend/.nvm/versions/node/v6.14.1/lib/node_modules/electron-forge/dist/api/makers/generic/dmg.js',
  '/Users/pixelfiend/.nvm/versions/node/v6.14.1/lib/node_modules/electron-forge/dist/api/node_modules/electron-forge-maker-dmg',
  '/Users/pixelfiend/.nvm/versions/node/v6.14.1/lib/node_modules/electron-forge/dist/api/node_modules/dmg',
  '/Users/pixelfiend/workspace/gif-goat/dmg',
  '/Users/pixelfiend/workspace/gif-goat/node_modules/dmg' ] relative to /Users/pixelfiend/.nvm/versions/node/v6.14.1/lib/node_modules/electron-forge/dist/api +0ms
  electron-forge:require-search testing ../makers/darwin/dmg.js +6ms
We need to package your application before we can make it
  electron-forge:lifecycle Process Started: Preparing to Package Application for arch: x64 +15ms
  electron-forge:project-resolver searching for project in: /Users/pixelfiend/workspace/gif-goat +20ms
  electron-forge:project-resolver electron-forge compatible package.json found in /Users/pixelfiend/workspace/gif-goat/package.json +1ms
  electron-forge:hook could not find hook: generateAssets +0ms
  electron-forge:hook could not find hook: prePackage +0ms
  electron-forge:packager packaging with options { asar: false,
  overwrite: true,
  packageManager: 'npm',
  icon: './src/assets/imgs/icon-1024.png',
  afterCopy: [ [Function] ],
  afterExtract: [ [Function] ],
  afterPrune: [ [Function] ],
  dir: '/Users/pixelfiend/workspace/gif-goat',
  arch: 'x64',
  platform: 'darwin',
  out: '/Users/pixelfiend/workspace/gif-goat/out',
  electronVersion: '1.8.4',
  quiet: true } +0ms
  electron-forge:lifecycle Process Succeeded: Preparing to Package Application for arch: x64 +50s
  electron-forge:lifecycle Process Started: Compiling Application +2ms
  electron-forge:lifecycle Process Succeeded: Compiling Application +2s
  electron-forge:lifecycle Process Started: Preparing native dependencies +13s
  electron-forge:lifecycle Process Succeeded: Preparing native dependencies +737ms
  electron-forge:lifecycle Process Started: Packaging Application +1ms
  electron-forge:hook could not find hook: postPackage +1m
  electron-forge:lifecycle Process Succeeded: Packaging Application +12s
Making for the following targets:
  electron-forge:hook could not find hook: preMake +3ms
  electron-forge:lifecycle Process Started: Making for target: dmg - On platform: darwin - For arch: x64 +6ms
  electron-forge:lifecycle Process Succeeded: Making for target: dmg - On platform: darwin - For arch: x64 +22s
  electron-forge:hook could not find hook: postMake +22s
  electron-forge:project-resolver searching for project in: /Users/pixelfiend/workspace/gif-goat +2m
  electron-forge:project-resolver electron-forge compatible package.json found in /Users/pixelfiend/workspace/gif-goat/package.json +1ms
  electron-forge:lifecycle Process Started: Resolving publish target: github +2ms
  electron-forge:require-search searching [ '../publishers/github.js',
  'electron-forge-publisher-github',
  'github',
  '/Users/pixelfiend/workspace/gif-goat/github',
  '/Users/pixelfiend/workspace/gif-goat/node_modules/github',
  '/Users/pixelfiend/.nvm/versions/node/v6.14.1/lib/node_modules/electron-forge/dist/publishers/github.js',
  '/Users/pixelfiend/.nvm/versions/node/v6.14.1/lib/node_modules/electron-forge/dist/api/electron-forge-publisher-github',
  '/Users/pixelfiend/.nvm/versions/node/v6.14.1/lib/node_modules/electron-forge/dist/api/github',
  '/Users/pixelfiend/workspace/gif-goat/github',
  '/Users/pixelfiend/workspace/gif-goat/node_modules/github',
  '/Users/pixelfiend/.nvm/versions/node/v6.14.1/lib/node_modules/electron-forge/dist/api/publishers/github.js',
  '/Users/pixelfiend/.nvm/versions/node/v6.14.1/lib/node_modules/electron-forge/dist/api/node_modules/electron-forge-publisher-github',
  '/Users/pixelfiend/.nvm/versions/node/v6.14.1/lib/node_modules/electron-forge/dist/api/node_modules/github',
  '/Users/pixelfiend/workspace/gif-goat/github',
  '/Users/pixelfiend/workspace/gif-goat/node_modules/github' ] relative to /Users/pixelfiend/.nvm/versions/node/v6.14.1/lib/node_modules/electron-forge/dist/api +2m
  electron-forge:require-search testing ../publishers/github.js +4ms
  electron-forge:lifecycle Process Succeeded: Resolving publish target: github +262ms
  electron-forge:lifecycle Process Started: Searching for target release +3ms
DEPRECATED: protocol option is no longer supported
  electron-forge:lifecycle Process Failed: Searching for target release +116ms

An unhandled error has occurred inside Forge:
request to https://undefined/repos/positlabs/gif-goat/releases?per_page=100 failed, reason: getaddrinfo ENOTFOUND undefined undefined:443
HttpError: request to https://undefined/repos/positlabs/gif-goat/releases?per_page=100 failed, reason: getaddrinfo ENOTFOUND undefined undefined:443
    at fetch.then.then.catch.error (/Users/pixelfiend/.nvm/versions/node/v6.14.1/lib/node_modules/electron-forge/node_modules/@octokit/rest/lib/request/request.js:88:13)
    at process._tickCallback (internal/process/next_tick.js:109:7)

What command line arguments are you passing?

electron-forge publish --target=github --platform=darwin

What does your config.forge data in package.json look like?

  "config": {
    "forge": {
      "make_targets": {
        "darwin": [
          "dmg"
        ]
      },
      "electronPackagerConfig": {
        "packageManager": "npm",
        "icon": "./src/assets/imgs/icon-1024.png"
      },
      "github_repository": {
        "owner": "positlabs",
        "name": "gif-goat"
      }
    }
  }

Please provide either a failing minimal testcase (with a link to the code) or detailed steps to reproduce your problem. Using electron-forge init is a good starting point, if that is not the source of your problem.

https://github.com/positlabs/gif-goat

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 17 (10 by maintainers)

Commits related to this issue

Most upvoted comments

Reopening since the 5.x PR isn’t merged yet (it’s being weird in CI)

I found it, octokit/rest.js “deprecated” config options in a minor release: https://github.com/octokit/rest.js/commit/96b9fc65616d062c9b422c941b0e87122721e4a1

I don’t think their deprecations work too well.

The workaround is to manually upload releases to github. Not the end of the world, but not ideal