Bug description
When opening the built app a JavaScript error occurs.
nativefier --help and https://github.com/jiahaog/nativefier/blob/master/docs/api.mdSteps to reproduce
nativefier https://google.com --name MyAppExpected behavior
The app should open properly
Actual behavior
An JavaScript Error occurs
Debug info

Context
Came here to report this very issue. Tried different URLs with same result.
Nativefier: 9.0.4 (installed via HomeBrew)
OS: Mac OSX Mojave 10.14.6
This is my first install of Nativefier. So "Last working" = never.
macOS Catalina: 10.15.5 (19F101)
nativefier --version
9.0.0
nativefier --name "Roam" https://roamresearch.com/#/app/primarydb
Preparing Electron app...
Converting icons...
Packaging... This will take a few seconds, maybe minutes if the requested Electron isn't cached yet...
Packaging app for platform darwin x64 using electron v9.0.4
Finalizing build...
App built to /Users/adamz/Roam-darwin-x64
md5-88996da4ab6a097462b60d28699e0557
A JavaScript error occurred in the main process
Uncaught Exception:
TypeError: Cannot read property 'show' of undefined
at App.<anonymous> (/Users/adamz/Roam-darwin-x64/Roam.app/Contents/Resources/app/lib/webpack:/src/main.ts:101:18)
at App.emit (events.js:223:5)
(worked fine with version 8.0.7)
@zethraeus What is your node and npm version?
@zethraeus What is your node and npm version?
I can also confirm a similar error that happened after upgrading to version 9.0.0 on macOS Catalina 10.15.5

❯ node --version
v14.4.0
~
❯ npm --version
6.14.5
~
❯ nativefier --version
9.0.0

Tested on Windows 10 1909 with:
> node --version
v12.18.0
> npm --version
6.14.4
> nativefier --version
9.0.0
Same result on macOS Catalina as others have posted above.
Thanks for the reports everybody! Very little changed between Nativefier 8.0.7 and 9.0.0, apart from a new major Electron, and Nativefier 9.0.0 works for me under Linux. So, I suspect Electron trouble.
@TFisicaro @zethraeus @schloram @MalEbenSo @kris-anderson, and all the voters of this issue (by the way, thaaaaaaaanks a million for just using the vote button if you want to confirm a bug and have nothing to add :heart:), can you try with an {older, beta} version of Electron? (Nativefier 9.0.0 uses Electron 9.0.4 by default)
-e 8.3.2 for the latest Electron 8.x-e 10.0.0-beta.3 for the latest Electron 10 beta, and report here with:
--verbose. So, should be nativefier --verbose -e [version] [your other options] [your url]--verbose build console output--
EDIT also, does the png/ico image reported as un-loadable in your error screenshots (/blah/blah/blah/icon.{ico,png}) actually exist in your filesystem, or not?
--
EDIT maybe related to this?
Thanks for your input @ronjouch!
Curiously, using, --verbose produces a different error message after the app has been built.
Here is my output for nativefier -i coda.icns -n "Coda" --clear-cache --verbose coda.io:
URL "coda.io" lacks a protocol. Will try to parse it as HTTPS: "https://coda.io". Please pass "http://coda.io" if this is what you meant.
Running in verbose mode! This will produce a mountain of logs and is recommended only for troubleshooting or if you like Shakespeare.Performing async options post-processing.
Inferring user agent for electron 9.0.4 / darwin
Grabbing electron<->chrome versions file from https://atom.io/download/atom-shell/index.json
Got icon from options. Using it, no inferring needed
Got name Coda from options. No inferring needed
Sanitized filename for Coda : Coda
Associated electron v9.0.4 to chrome v83.0.4103.104
Given chrome 83.0.4103.104 on darwin, using user agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.104 Safari/537.36Preparing Electron app...
Copying electron app from /Users/sebastian/.npm-global/lib/node_modules/nativefier/app to /var/folders/99/dj_bt_kj7410dlry793g5g5m0000gn/T/nativefier-15-36-19-app--54349-2Lh2915o295o
Writing app config to /var/folders/99/dj_bt_kj7410dlry793g5g5m0000gn/T/nativefier-15-36-19-app--54349-2Lh2915o295o/nativefier.json
No files to inject, skipping copy.
Updating /var/folders/99/dj_bt_kj7410dlry793g5g5m0000gn/T/nativefier-15-36-19-app--54349-2Lh2915o295o/package.json 'name' field to coda-nativefier-f8b47cConverting icons...
Building for macOS and icon is already a .icns, no conversion neededPackaging... This will take a few seconds, maybe minutes if the requested Electron isn't cached yet...
electron-packager Electron Packager 14.2.1
electron-packager Node v8.11.1
electron-packager Host Operating system: darwin 19.4.0 (x64) +0ms
electron-packager Packager Options: {"arch":"x64","asar":false,"darwinDarkModeSupport":false,"dir":"/var/folders/99/dj_bt_kj7410dlry793g5g5m0000gn/T/nativefier-15-36-19-app--54349-2Lh2915o295o","electronVersion":"9.0.4","icon":"coda.icns","name":"Coda","out":"/Users/sebastian/Downloads/coda packaging","overwrite":true,"platform":"darwin","targetUrl":"https://coda.io/","tmpdir":false,"win32metadata":{"ProductName":"Coda","InternalName":"Coda","FileDescription":"Coda"}} +1ms
electron-packager Target Platforms: darwin +1ms
electron-packager Target Architectures: x64 +0ms
electron-packager Inferring appVersion from version in /var/folders/99/dj_bt_kj7410dlry793g5g5m0000gn/T/nativefier-15-36-19-app--54349-2Lh2915o295o/package.json +0ms
electron-packager Application name: Coda +19ms
electron-packager Target Electron version: 9.0.4 +0ms
electron-packager Ignored path regular expressions: [ '/\.git($|/)', '/node_modules/\.bin($|/)', '\.o(bj)?$' ] +0ms
electron-packager Downloading Electron with options {"platform":"darwin","arch":"x64","version":"9.0.4","artifactName":"electron"} +0ms
Packaging app for platform darwin x64 using electron v9.0.4
electron-packager Creating /Users/sebastian/Downloads/coda packaging/darwin-x64-template +12ms
electron-packager Extracting /Users/sebastian/Library/Caches/electron/httpsgithub.comelectronelectronreleasesdownloadv9.0.4electron-v9.0.4-darwin-x64.zip/electron-v9.0.4-darwin-x64.zip to /Users/sebastian/Downloads/coda packaging/darwin-x64-template +1ms
electron-packager Initializing app in /Users/sebastian/Downloads/coda packaging/Coda-darwin-x64 from /Users/sebastian/Downloads/coda packaging/darwin-x64-template template +0ms
electron-packager Ignored paths based on the out param: [ '/Users/sebastian/Downloads/coda packaging/Coda-darwin-x64',
'/Users/sebastian/Downloads/coda packaging/Coda-linux-ia32',
'/Users/sebastian/Downloads/coda packaging/Coda-linux-x64',
'/Users/sebastian/Downloads/coda packaging/Coda-linux-armv7l',
'/Users/sebastian/Downloads/coda packaging/Coda-linux-arm64',
'/Users/sebastian/Downloads/coda packaging/Coda-linux-mips64el',
'/Users/sebastian/Downloads/coda packaging/Coda-mas-x64',
'/Users/sebastian/Downloads/coda packaging/Coda-win32-ia32',
'/Users/sebastian/Downloads/coda packaging/Coda-win32-x64',
'/Users/sebastian/Downloads/coda packaging/Coda-win32-arm64' ] +5s
electron-packager Copying icon "coda.icns" to app's Resources as "electron.icns" +0ms
electron-packager Renaming Electron to Coda in /Users/sebastian/Downloads/coda packaging/Coda-darwin-x64/Electron.app/Contents/MacOS +105ms
electron-packager Renaming Electron Helper to Coda Helper in /Users/sebastian/Downloads/coda packaging/Coda-darwin-x64/Electron.app/Contents/Frameworks/Electron Helper.app/Contents/MacOS +3ms
electron-packager Renaming Electron Helper (Renderer) to Coda Helper (Renderer) in /Users/sebastian/Downloads/coda packaging/Coda-darwin-x64/Electron.app/Contents/Frameworks/Electron Helper (Renderer).app/Contents/MacOS +1ms
electron-packager Renaming Electron Helper (Plugin) to Coda Helper (Plugin) in /Users/sebastian/Downloads/coda packaging/Coda-darwin-x64/Electron.app/Contents/Frameworks/Electron Helper (Plugin).app/Contents/MacOS +0ms
electron-packager Renaming Electron Helper (GPU) to Coda Helper (GPU) in /Users/sebastian/Downloads/coda packaging/Coda-darwin-x64/Electron.app/Contents/Frameworks/Electron Helper (GPU).app/Contents/MacOS +1ms
electron-packager Renaming Electron Helper.app to Coda Helper.app in /Users/sebastian/Downloads/coda packaging/Coda-darwin-x64/Electron.app/Contents/Frameworks +0ms
electron-packager Renaming Electron Helper (Renderer).app to Coda Helper (Renderer).app in /Users/sebastian/Downloads/coda packaging/Coda-darwin-x64/Electron.app/Contents/Frameworks +1ms
electron-packager Renaming Electron Helper (Plugin).app to Coda Helper (Plugin).app in /Users/sebastian/Downloads/coda packaging/Coda-darwin-x64/Electron.app/Contents/Frameworks +1ms
electron-packager Renaming Electron Helper (GPU).app to Coda Helper (GPU).app in /Users/sebastian/Downloads/coda packaging/Coda-darwin-x64/Electron.app/Contents/Frameworks +0msFinalizing build...
Copying icons if necessary
No copying necessary on macOS; aborting
App built to /Users/sebastian/Downloads/coda packaging/Coda-darwin-x64
This will lead to the following error on app-opening:

Not using --verbose leads to the error reported first by @schloram.
When building with electron 8.3.2 the error disappears for me.
The site "dhl.de" works flawlessly.
The site "ebay-kleinanzeigen.de" also starts without the error message. Then the login fails: just white window, nothing happening. This seems to be a different problem.
System info
Nativefier: 9.0.4 (installed via HomeBrew)
OS: macOS Mojave 10.14.6
node: 14.4.0
npm: 6.14.4
Attachments
a) screenshot of error message for dhl.de with electron 9.0.4 (default)
b) screenshot of error message for ebay-kleinanzeigen.de with electron 9.0.4 (default)
c) verbose output when building with 9.0.4 and 8.3.2.
verbose_output.pdf


Thanks for the other hint to fallback to an earlier Electron-version @ronjouch.
As also reported by @MalEbenSo using -e 8.3.2 also succeeds to build here. 👍
I have the same exact problem as @schloram, trying to generate a GitLab app.
I have tried with various Electron versions (from 5 to 10) and none of them worked for me. From 5 to 8 I only have a white screen when launching the app. For version 9 I have the same error dialog as @schloram. For version 10-beta I have an error report window.
Since the error with Electron 9 reports a problem with the image, I have tried passing the icon when calling nativefier, but to no effect.
Before that I've never encountered this problem with nativefier, but I don't know what version I was using before (probably an 8.x version).
Here are the details.
Command
nativefier --name "GitLab" --maximize --single-instance --internal-urls ".+" -e 8.3.2 -i logos/gitlab.png --verbose "https://gitlab.com/"
Context
Verbose
URL ".+" lacks a protocol. Will try to parse it as HTTPS: "https://.+". Please pass "http://.+" if this is what you meant.
Running in verbose mode! This will produce a mountain of logs and is recommended only for troubleshooting or if you like Shakespeare.
ATTENTION: Using **old** Electron version 8.3.2 as requested.
It's untested, bugs and horror will happen, you're on your own.
Simply abort & re-run without passing the version flag to default to 9.0.4
Performing async options post-processing.
Inferring user agent for electron 8.3.2 / darwin
Grabbing electron<->chrome versions file from https://atom.io/download/atom-shell/index.json
Got icon from options. Using it, no inferring needed
Got name GitLab from options. No inferring needed
Sanitized filename for GitLab : GitLab
Associated electron v8.3.2 to chrome v80.0.3987.165
Given chrome 80.0.3987.165 on darwin, using user agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.165 Safari/537.36
Preparing Electron app...
Copying electron app from /usr/local/lib/node_modules/nativefier/app to /var/folders/nm/89jj4cls3rsbb4xfbkp99mb00000gn/T/nativefier-16-48-27-app--29562-aeQWvTSHfpTA
Writing app config to /var/folders/nm/89jj4cls3rsbb4xfbkp99mb00000gn/T/nativefier-16-48-27-app--29562-aeQWvTSHfpTA/nativefier.json
No files to inject, skipping copy.
Updating /var/folders/nm/89jj4cls3rsbb4xfbkp99mb00000gn/T/nativefier-16-48-27-app--29562-aeQWvTSHfpTA/package.json 'name' field to gitlab-nativefier-4b2337
Converting icons...
Converting icon logos/gitlab.png to /var/folders/nm/89jj4cls3rsbb4xfbkp99mb00000gn/T/nativefier-16-48-27-iconconv--29562-pkMeZf5hEyl8/icon.icns. Calling: "/usr/local/lib/node_modules/nativefier/icon-scripts/convertToIcns" "logos/gitlab.png" "/var/folders/nm/89jj4cls3rsbb4xfbkp99mb00000gn/T/nativefier-16-48-27-iconconv--29562-pkMeZf5hEyl8/icon.icns"
Conversion succeeded and produced icon at /var/folders/nm/89jj4cls3rsbb4xfbkp99mb00000gn/T/nativefier-16-48-27-iconconv--29562-pkMeZf5hEyl8/icon.icns
Packaging... This will take a few seconds, maybe minutes if the requested Electron isn't cached yet...
electron-packager Electron Packager 14.2.1
electron-packager Node v14.3.0
electron-packager Host Operating system: darwin 18.7.0 (x64) +0ms
electron-packager Packager Options: {"arch":"x64","asar":false,"darwinDarkModeSupport":false,"dir":"/var/folders/nm/89jj4cls3rsbb4xfbkp99mb00000gn/T/nativefier-16-48-27-app--29562-aeQWvTSHfpTA","electronVersion":"8.3.2","icon":"/var/folders/nm/89jj4cls3rsbb4xfbkp99mb00000gn/T/nativefier-16-48-27-iconconv--29562-pkMeZf5hEyl8/icon.icns","name":"GitLab","out":"https://gitlab.com/","overwrite":true,"platform":"darwin","targetUrl":"https://.+/","tmpdir":false,"win32metadata":{"ProductName":"GitLab","InternalName":"GitLab","FileDescription":"GitLab"}} +0ms
electron-packager Target Platforms: darwin +0ms
electron-packager Target Architectures: x64 +0ms
electron-packager Inferring appVersion from version in /var/folders/nm/89jj4cls3rsbb4xfbkp99mb00000gn/T/nativefier-16-48-27-app--29562-aeQWvTSHfpTA/package.json +0ms
electron-packager Application name: GitLab +6ms
electron-packager Target Electron version: 8.3.2 +0ms
electron-packager Ignored path regular expressions: [ '/\\.git($|/)', '/node_modules/\\.bin($|/)', '\\.o(bj)?$' ] +0ms
electron-packager Downloading Electron with options {"platform":"darwin","arch":"x64","version":"8.3.2","artifactName":"electron"} +0ms
Packaging app for platform darwin x64 using electron v8.3.2
electron-packager Creating /Applications/nativefier/https:/gitlab.com/darwin-x64-template +5ms
electron-packager Extracting /Users/mmmmore/Library/Caches/electron/httpsgithub.comelectronelectronreleasesdownloadv8.3.2electron-v8.3.2-darwin-x64.zip/electron-v8.3.2-darwin-x64.zip to /Applications/nativefier/https:/gitlab.com/darwin-x64-template +0ms
electron-packager Initializing app in https:/gitlab.com/GitLab-darwin-x64 from /Applications/nativefier/https:/gitlab.com/darwin-x64-template template +0ms
electron-packager Ignored paths based on the out param: [ '/Applications/nativefier/https:/gitlab.com' ] +1s
electron-packager Copying icon "/var/folders/nm/89jj4cls3rsbb4xfbkp99mb00000gn/T/nativefier-16-48-27-iconconv--29562-pkMeZf5hEyl8/icon.icns" to app's Resources as "electron.icns" +0ms
electron-packager Renaming Electron to GitLab in https:/gitlab.com/GitLab-darwin-x64/Electron.app/Contents/MacOS +56ms
electron-packager Renaming Electron Helper to GitLab Helper in https:/gitlab.com/GitLab-darwin-x64/Electron.app/Contents/Frameworks/Electron Helper.app/Contents/MacOS +0ms
electron-packager Renaming Electron Helper (Renderer) to GitLab Helper (Renderer) in https:/gitlab.com/GitLab-darwin-x64/Electron.app/Contents/Frameworks/Electron Helper (Renderer).app/Contents/MacOS +1ms
electron-packager Renaming Electron Helper (Plugin) to GitLab Helper (Plugin) in https:/gitlab.com/GitLab-darwin-x64/Electron.app/Contents/Frameworks/Electron Helper (Plugin).app/Contents/MacOS +0ms
electron-packager Renaming Electron Helper (GPU) to GitLab Helper (GPU) in https:/gitlab.com/GitLab-darwin-x64/Electron.app/Contents/Frameworks/Electron Helper (GPU).app/Contents/MacOS +0ms
electron-packager Renaming Electron Helper.app to GitLab Helper.app in https:/gitlab.com/GitLab-darwin-x64/Electron.app/Contents/Frameworks +0ms
electron-packager Renaming Electron Helper (Renderer).app to GitLab Helper (Renderer).app in https:/gitlab.com/GitLab-darwin-x64/Electron.app/Contents/Frameworks +0ms
electron-packager Renaming Electron Helper (Plugin).app to GitLab Helper (Plugin).app in https:/gitlab.com/GitLab-darwin-x64/Electron.app/Contents/Frameworks +0ms
electron-packager Renaming Electron Helper (GPU).app to GitLab Helper (GPU).app in https:/gitlab.com/GitLab-darwin-x64/Electron.app/Contents/Frameworks +0ms
Finalizing build...
Copying icons if necessary
No copying necessary on macOS; aborting
App built to https:/gitlab.com/GitLab-darwin-x64
Thanks for your input @ronjouch!
Curiously, using,
--verboseproduces a different error message after the app has been built.
...
I get this message when I try to relaunch the app after failing to close the app after the original (icon.png) error message.
It seems electron wants an icon.png in the Resources dir ... I fixed my Gmail app by doing this:
sips -s format png Gmail-darwin-x64/Gmail.app/Contents/Resources/electron.icns --out Gmail-darwin-x64/Gmail.app/Contents/Resources/app/icon.png
(e.g. generated a .png from the embedded .icns file)
macOS: 10.15.4
$ node --version
v14.4.0
$ npm --version
6.14.4
$ nativefier --version
9.0.0
Thanks for the other hint to fallback to an earlier Electron-version @ronjouch.
As also reported by @MalEbenSo using
-e 8.3.2also succeeds to build here. 👍
I can also confirm this works for me.
Passing -e 10.0.0-beta.3 results in the app crashing immediately upon startup with no error message.
Here's the verbose output when I run this without the -e parameter:
❯ nativefier --name "Google Calendar" "https://calendar.google.com" "$HOME/Applications/" --verbose
Running in verbose mode! This will produce a mountain of logs and is recommended only for troubleshooting or if you like Shakespeare.
Performing async options post-processing.
Inferring user agent for electron 9.0.4 / darwin
Grabbing electron<->chrome versions file from https://atom.io/download/atom-shell/index.json
Inferring icon for https://calendar.google.com/ on darwin
Inferring icon from store for https://calendar.google.com/ on darwin
Allowed icon formats when building for darwin: [ '.icns', '.png', '.ico' ]
Got name Google Calendar from options. No inferring needed
Sanitized filename for Google Calendar : Google Calendar
Got 249 icons from gitcloud
Max icon match score: 2
Downloading https://jiahaog.github.io/nativefier-icons/files/google-calendar.png
Got an icon from the page.
Writing 19.1 kb icon to /var/folders/_k/hrxc6w_d4rx84_k6cpd1hzkw0000gn/T/nativefier-14-31-46-iconinfer--11318-eAD3qj8pSU6u/icon.png
Associated electron v9.0.4 to chrome v83.0.4103.104
Given chrome 83.0.4103.104 on darwin, using user agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.104 Safari/537.36
Preparing Electron app...
Copying electron app from /usr/local/Cellar/nativefier/9.0.0/libexec/lib/node_modules/nativefier/app to /var/folders/_k/hrxc6w_d4rx84_k6cpd1hzkw0000gn/T/nativefier-14-31-46-app--11318-Kx9HD0L4S3BL
Writing app config to /var/folders/_k/hrxc6w_d4rx84_k6cpd1hzkw0000gn/T/nativefier-14-31-46-app--11318-Kx9HD0L4S3BL/nativefier.json
No files to inject, skipping copy.
Updating /var/folders/_k/hrxc6w_d4rx84_k6cpd1hzkw0000gn/T/nativefier-14-31-46-app--11318-Kx9HD0L4S3BL/package.json 'name' field to google-calendar-nativefier-e22938
Converting icons...
Converting icon /var/folders/_k/hrxc6w_d4rx84_k6cpd1hzkw0000gn/T/nativefier-14-31-46-iconinfer--11318-eAD3qj8pSU6u/icon.png to /var/folders/_k/hrxc6w_d4rx84_k6cpd1hzkw0000gn/T/nativefier-14-31-46-iconconv--11318-PlKPoczYofvl/icon.icns. Calling: "/usr/local/Cellar/nativefier/9.0.0/libexec/lib/node_modules/nativefier/icon-scripts/convertToIcns" "/var/folders/_k/hrxc6w_d4rx84_k6cpd1hzkw0000gn/T/nativefier-14-31-46-iconinfer--11318-eAD3qj8pSU6u/icon.png" "/var/folders/_k/hrxc6w_d4rx84_k6cpd1hzkw0000gn/T/nativefier-14-31-46-iconconv--11318-PlKPoczYofvl/icon.icns"
Conversion succeeded and produced icon at /var/folders/_k/hrxc6w_d4rx84_k6cpd1hzkw0000gn/T/nativefier-14-31-46-iconconv--11318-PlKPoczYofvl/icon.icns
Packaging... This will take a few seconds, maybe minutes if the requested Electron isn't cached yet...
electron-packager Electron Packager 14.2.1
electron-packager Node v14.4.0
electron-packager Host Operating system: darwin 19.5.0 (x64) +0ms
electron-packager Packager Options: {"arch":"x64","asar":false,"darwinDarkModeSupport":false,"dir":"/var/folders/_k/hrxc6w_d4rx84_k6cpd1hzkw0000gn/T/nativefier-14-31-46-app--11318-Kx9HD0L4S3BL","electronVersion":"9.0.4","icon":"/var/folders/_k/hrxc6w_d4rx84_k6cpd1hzkw0000gn/T/nativefier-14-31-46-iconconv--11318-PlKPoczYofvl/icon.icns","name":"Google Calendar","out":"/Users/kris/Applications/","overwrite":true,"platform":"darwin","targetUrl":"https://calendar.google.com/","tmpdir":false,"win32metadata":{"ProductName":"Google Calendar","InternalName":"Google Calendar","FileDescription":"Google Calendar"}} +0ms
electron-packager Target Platforms: darwin +0ms
electron-packager Target Architectures: x64 +0ms
electron-packager Inferring appVersion from version in /var/folders/_k/hrxc6w_d4rx84_k6cpd1hzkw0000gn/T/nativefier-14-31-46-app--11318-Kx9HD0L4S3BL/package.json +0ms
electron-packager Application name: Google Calendar +6ms
electron-packager Target Electron version: 9.0.4 +0ms
electron-packager Ignored path regular expressions: [ '/\\.git($|/)', '/node_modules/\\.bin($|/)', '\\.o(bj)?$' ] +0ms
electron-packager Downloading Electron with options {"platform":"darwin","arch":"x64","version":"9.0.4","artifactName":"electron"} +0ms
Packaging app for platform darwin x64 using electron v9.0.4
electron-packager Creating /Users/kris/Applications/darwin-x64-template +3ms
electron-packager Extracting /Users/kris/Library/Caches/electron/httpsgithub.comelectronelectronreleasesdownloadv9.0.4electron-v9.0.4-darwin-x64.zip/electron-v9.0.4-darwin-x64.zip to /Users/kris/Applications/darwin-x64-template +1ms
electron-packager Initializing app in /Users/kris/Applications/Google Calendar-darwin-x64 from /Users/kris/Applications/darwin-x64-template template +0ms
electron-packager Ignored paths based on the out param: [ '/Users/kris/Applications' ] +2s
electron-packager Copying icon "/var/folders/_k/hrxc6w_d4rx84_k6cpd1hzkw0000gn/T/nativefier-14-31-46-iconconv--11318-PlKPoczYofvl/icon.icns" to app's Resources as "electron.icns" +0ms
electron-packager Renaming Electron to Google Calendar in /Users/kris/Applications/Google Calendar-darwin-x64/Electron.app/Contents/MacOS +72ms
electron-packager Renaming Electron Helper to Google Calendar Helper in /Users/kris/Applications/Google Calendar-darwin-x64/Electron.app/Contents/Frameworks/Electron Helper.app/Contents/MacOS +0ms
electron-packager Renaming Electron Helper (Renderer) to Google Calendar Helper (Renderer) in /Users/kris/Applications/Google Calendar-darwin-x64/Electron.app/Contents/Frameworks/Electron Helper (Renderer).app/Contents/MacOS +1ms
electron-packager Renaming Electron Helper (Plugin) to Google Calendar Helper (Plugin) in /Users/kris/Applications/Google Calendar-darwin-x64/Electron.app/Contents/Frameworks/Electron Helper (Plugin).app/Contents/MacOS +0ms
electron-packager Renaming Electron Helper (GPU) to Google Calendar Helper (GPU) in /Users/kris/Applications/Google Calendar-darwin-x64/Electron.app/Contents/Frameworks/Electron Helper (GPU).app/Contents/MacOS +0ms
electron-packager Renaming Electron Helper.app to Google Calendar Helper.app in /Users/kris/Applications/Google Calendar-darwin-x64/Electron.app/Contents/Frameworks +0ms
electron-packager Renaming Electron Helper (Renderer).app to Google Calendar Helper (Renderer).app in /Users/kris/Applications/Google Calendar-darwin-x64/Electron.app/Contents/Frameworks +0ms
electron-packager Renaming Electron Helper (Plugin).app to Google Calendar Helper (Plugin).app in /Users/kris/Applications/Google Calendar-darwin-x64/Electron.app/Contents/Frameworks +0ms
electron-packager Renaming Electron Helper (GPU).app to Google Calendar Helper (GPU).app in /Users/kris/Applications/Google Calendar-darwin-x64/Electron.app/Contents/Frameworks +0ms
Finalizing build...
Copying icons if necessary
No copying necessary on macOS; aborting
App built to /Users/kris/Applications/Google Calendar-darwin-x64
It seems electron wants an
icon.pngin theResourcesdir ... I fixed my Gmail app by doing this:sips -s format png Gmail-darwin-x64/Gmail.app/Contents/Resources/electron.icns --out Gmail-darwin-x64/Gmail.app/Contents/Resources/app/icon.png(e.g. generated a .png from the embedded .icns file)
Great @sebmartin! This did the trick! Having an icon.png file in the <MyApp-darwin-x64>/MyApp.app/Contents/Resources/app folder removes the error dialog and the app starts normally.
I've used these commands:
$ nativefier --name "GitLab" --maximize --single-instance --internal-urls --icon logos/gitlab.png "https://gitlab.com/"
$ cp logos/gitlab.png GitLab-darwin-x64/GitLab.app/Contents/Resources/app/icon.png
(since I have the png file already, I don't use sips, I simply copy it where it's needed).
Yep, fixing this was as simple as adding an icon.png file to the path indicated by the error message: <name>.app/Contents/Resources/app/!
Command run:
nativefier --name "Asana" "https://app.asana.com" --min-width 750 --min-height 300 --hide-window-frame --single-instance
Error:

Fix:
Used this website to convert the electron.icns file in <name>.app/Contents/Resources/ to a PNG, then renamed that PNG to icon.png and placed it in <name>.app/Contents/Resources/app/. (I assume any PNG would have done the trick.)
@ronjouch Thanks for your reply. -e 8.3.2 seems to work. However -e 10.0.0-beta.3 does not. With this the app doesn't even start and no error message is shown (as described by @kris-anderson here).
EDIT also, does the png/ico image reported as un-loadable in your error screenshots (
/blah/blah/blah/icon.{ico,png}) actually exist in your filesystem, or not?
I can confirm like some others before that the icon does not exist but placing a png file by hand in there after the app is being built works. But this of course should not considered a fix. More a temporary workaround 😊
Any solution for this except using an old Electron version? Placing a icon.png file is not a solution and does not work all the time.
Thank you very much.
Any solution for this except using an old Electron version? Placing a icon.png file is not a solution and does not work all the time.
Thank you very much.
Can you provide reproducible steps that show it doesn't work? This is important because otherwise, the likely solution that will be implemented is adding a .png during the build process. So if that's not working, by your claim, the community and authors would benefit from knowing in which situations it doesn't work so they can find a more universal solution.
When I add it manually the path on a Mac cannot be created, otherwise I do understand somethings wrong.
You won't be able to create a folder name like: App Name.app
When I add it manually the path on a Mac cannot be created, otherwise I do understand somethings wrong.
You won't be able to create a folder name like: App Name.app
Copying the icon.png file into the folder doesn't work for 2 of the apps I've tried. Only the Electron fallback is working.
That fixed the issue for me
Using the -e 8.3.2 option in addition to manually copying the icon.png file into AppName.app/Contents/Resources/apps/icon.png solved the issue for me.
This should be fixed in f234473, folks, please try it with a developer build, or wait for the next release.
I'm seeing this too, when is a new release planned?
I'm seeing this too, when is a new release planned?
@simonweil is is released as 9.1.0
This should be fixed in f234473, folks, please try it with a developer build, or wait for the next release.
I can confirm that this works like a charm with version 9.1.0. Good job everybody.
Can confirm too that it's working, thank you so much!
Most helpful comment
Thanks for the reports everybody! Very little changed between Nativefier 8.0.7 and 9.0.0, apart from a new major Electron, and Nativefier 9.0.0 works for me under Linux. So, I suspect Electron trouble.
@TFisicaro @zethraeus @schloram @MalEbenSo @kris-anderson, and all the voters of this issue (by the way, thaaaaaaaanks a million for just using the vote button if you want to confirm a bug and have nothing to add :heart:), can you try with an {older, beta} version of Electron? (Nativefier 9.0.0 uses Electron 9.0.4 by default)
-e 8.3.2for the latest Electron 8.x-e 10.0.0-beta.3for the latest Electron 10 beta, and report here with:
--verbose. So, should benativefier --verbose -e [version] [your other options] [your url]--verbosebuild console output--
EDIT also, does the png/ico image reported as un-loadable in your error screenshots (
/blah/blah/blah/icon.{ico,png}) actually exist in your filesystem, or not?--
EDIT maybe related to this?