Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AppImage started failing when file association contains multiple extensions #3204

Closed
lutzroeder opened this issue Aug 4, 2018 · 11 comments
Closed

Comments

@lutzroeder
Copy link
Contributor

lutzroeder commented Aug 4, 2018

  • Version: 20.26.1
  • Target: Linux/AppImage

npx electron-builder --linux started failing when electron-builder.yml or package.json contains multiple file extensions for a single association. Works when building --mac and --win.

  ⨯ appimage.AppImageConfiguration.FileAssociations: []appimage.FileAssociation: appimage.FileAssociation.Ext: ReadString: expects " or n, but found [, error found in #10 byte of ...|t","ext":["txt","doc|..., bigger context ...|6}],"fileAssociations":[{"name":"Document","ext":["txt","doc"]}]}|...

Simple repro: repro3204.zip

@lutzroeder
Copy link
Contributor Author

lutzroeder commented Aug 4, 2018

@develar, @AdrianoFerrari, is this a recent regression in AppImage file extension support?

@AdrianoFerrari
Copy link
Contributor

AdrianoFerrari commented Aug 4, 2018

Thanks for making it easy to reproduce.
I'll look into this in pockets of time over next few days.

@AdrianoFerrari
Copy link
Contributor

First impressions, @lutzroeder :
As far as I can tell FileAssociation should contain both a name and an ext, for each entry. So it should probably be:

[{"name":"Document","ext":"txt"}, {"name":"Document", "ext": "doc"}]

Or in YAML:

fileAssociations:
  - name: Document
    ext: txt
  - name: Document
    ext: doc

Seems to run OK when I do that (well, except for other package.json complains like missing author email).

Not sure why that would have worked with --mac and --win though...

@lutzroeder
Copy link
Contributor Author

Makes sense and thank you for looking into this. Guess it should either turn into a breaking change allowing only one extension per association and Win/Mac should flag arrays as an error as well or it should be fixed for AppImage.

@develar
Copy link
Member

develar commented Aug 5, 2018

It is regression and will be addressed soon.

c3er added a commit to c3er/mdview that referenced this issue Oct 28, 2018
The entry for building deb packages was removed, because I could not manage to get it working.

Registering multiple file associations was changed, because of Electron-Builder issue  #3204 (electron-userland/electron-builder#3204).
@fxha
Copy link

fxha commented Apr 11, 2019

This issue is still not fixed. Any progress here or wontfix but please update the documentation if so?

@fxha
Copy link

fxha commented Apr 11, 2019

There is another problem associated with the workaround @AdrianoFerrari mentioned. The workaround also fails when using the same icon for more than one entry on macOS.

  • Multiple extension in one entry result in an error on Linux: log
  • Using multiple entries but same icon result in an error on macOS: log

@ollm
Copy link

ollm commented Jan 23, 2020

This error is still present when build AppImage in the current version of electron-builder (22.3.1)

This is the error you are currently giving:

⨯ appimage.AppImageConfiguration.FileAssociations: []appimage.FileAssociation: appimage.FileAssociation.Ext: ReadString: expects " or n, but found [, error found in #10 byte of ...|G","ext":["jpg","jpe|..., bigger context ...|eAssociations":[{"description":"Image JPG","ext":["jpg","jpeg","jif","jfi","jfif","jfif-tbnl","jpe"]|...  
⨯ /my-app-dir/node_modules/app-builder-bin/linux/x64/app-builder exited with code ERR_ELECTRON_BUILDER_CANNOT_EXECUTE  stackTrace=
           Error: /my-app-dir/node_modules/app-builder-bin/linux/x64/app-builder exited with code ERR_ELECTRON_BUILDER_CANNOT_EXECUTE
               at ChildProcess.<anonymous> (/my-app-dir/node_modules/builder-util/src/util.ts:239:14)
               at Object.onceWrapper (events.js:313:26)
               at ChildProcess.emit (events.js:223:5)
               at maybeClose (internal/child_process.js:1021:16)
               at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)

For example, this works

"fileAssociations": [
	{
		"description": "Image JPG",
		"ext": "jpg",
		"role": "Viewer"
	}
]

But this gives error

"fileAssociations": [
	{
		"description": "Image JPG",
		"ext": [
			"jpg",
			"jpeg",
			"jif",
			"jfi",
			"jfif",
			"jfif-tbnl",
			"jpe"
		],
		"role": "Viewer"
	}
]

@Kilian
Copy link
Contributor

Kilian commented Jul 29, 2021

as of 22.11.8 this is still an issue.

@arantes555
Copy link

Also still having the same issue.

@AlanSean
Copy link

AlanSean commented Jan 5, 2022

as of 22.13.1 this is still an issue.

luxuereal added a commit to luxuereal/md_viewer_electron that referenced this issue Jun 16, 2023
The entry for building deb packages was removed, because I could not manage to get it working.

Registering multiple file associations was changed, because of Electron-Builder issue  #3204 (electron-userland/electron-builder#3204).
luxuereal added a commit to luxuereal/md_viewer_electron that referenced this issue Dec 12, 2023
The entry for building deb packages was removed, because I could not manage to get it working.

Registering multiple file associations was changed, because of Electron-Builder issue  #3204 (electron-userland/electron-builder#3204).
SleepyLeslie added a commit to gristlabs/grist-desktop that referenced this issue Aug 7, 2024
SleepyLeslie added a commit to gristlabs/grist-desktop that referenced this issue Aug 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants