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.
anyone have a workaround here? this seems to have forced my development to a grinding halt
The workaround is to manually upload releases to github. Not the end of the world, but not ideal
@positlabs cool. i have been doing this in the meantime. thanks!
@benjtinsley @positlabs If you delete your node_modules directory and re-install it does it start working âť“
@MarshallOfSound thanks for the suggestion, unfortunately that does not fix.
@positlabs may be onto something by suggesting that it is a problem within octokit, or possibly electron-forge using an outdated version of octokit. without having much knowledge on typescript or octokit/rest.js it looks like the use of it in the electron-forge publish package differs from the advertised api on the rest.js repo.
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.
@malept Should ping the folks on octokit, that's something they need to be aware of and revert till a major release
@MarshallOfSound once I make the PR for master, I'll see if I can make a minimal testcase for them.
Filed an issue upstream: https://github.com/octokit/rest.js/issues/848
Reopening since the 5.x PR isn't merged yet (it's being weird in CI)
While we're waiting for 5.x CI to behave itself, you should be able to work around this by adding this to forge config:
config: {
forge: {
github_repository: {
options: {
protocol: undefined
}
}
}
}
new version maybe should use baseUrl
in v15.2.7 so we can set protocol and host
"github_repository": {
"owner": "MiYogurt",
"name": "mmmmh",
"options": {
protocol: 'https',
host: 'api.github.com'
}
},
https://runkit.com/gr2m/5aecb07ba3c91a00124a1be9/branches/master
https://runkit.com/miyogurt/5aeda76a7959c10012739695
I guess I need to be clearer:
Workaround for Electron Forge 5.2.0: follow the directions in my previous comment.
github.com: you don't need to do anything else.config.forge.github_repository.options.baseUrl.For Electron Forge 5.2.1 (which is not released yet due to issues with CI):
github.com: you don't need to do anything special.config.forge.github_repository.options.baseUrl.if not set protocol and host i will get undefined error。 if set protocol is undefined always get undefined error。
This is what happens when you set protocol to undefined: https://runkit.com/malept/octokit-undefined-protocol
api.github.com is the default host.
Merged / fixed now 👍
Most helpful comment
https://github.com/octokit/rest.js/blob/2050cfd22b1479da63926e0b8e3c9bf716b2ae3e/lib/parse-client-options.js#L28
new version maybe should use baseUrl
https://github.com/octokit/rest.js/blob/2050cfd22b1479da63926e0b8e3c9bf716b2ae3e/lib/parse-client-options.js#L54
in v15.2.7 so we can set
protocolandhosthttps://runkit.com/gr2m/5aecb07ba3c91a00124a1be9/branches/master
https://runkit.com/miyogurt/5aeda76a7959c10012739695
https://github.com/octokit/rest.js/issues/848