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

Discord (ordinary) with openasar doesn't work #208749

Closed
dibusure opened this issue Jan 2, 2023 · 15 comments
Closed

Discord (ordinary) with openasar doesn't work #208749

dibusure opened this issue Jan 2, 2023 · 15 comments

Comments

@dibusure
Copy link

dibusure commented Jan 2, 2023

Describe the bug

When i open the discord (at cli too) it crashes with error:

[OpenAsar > Modules] Checking
Error: Cannot find module '/home/dibusure/.config/discord/0.0.22/modules/discord_desktop_core'
Require stack:
- /nix/store/30i97k1vnv44j23qrw8xix0bh9xyrirs-discord-0.0.22/opt/Discord/resources/app.asar/utils/requireNative.js
- /nix/store/30i97k1vnv44j23qrw8xix0bh9xyrirs-discord-0.0.22/opt/Discord/resources/app.asar/bootstrap.js
- /nix/store/30i97k1vnv44j23qrw8xix0bh9xyrirs-discord-0.0.22/opt/Discord/resources/app.asar/index.js
- 
    at Module._resolveFilename (internal/modules/cjs/loader.js:887:15)
    at Function.n._resolveFilename (electron/js2c/browser_init.js:261:1128)
    at Module._load (internal/modules/cjs/loader.js:732:27)
    at Function.f._load (electron/js2c/asar_bundle.js:5:12913)
    at Module.require (internal/modules/cjs/loader.js:959:19)
    at require (internal/modules/cjs/helpers.js:88:18)
    at module.exports (/nix/store/30i97k1vnv44j23qrw8xix0bh9xyrirs-discord-0.0.22/opt/Discord/resources/app.asar/utils/requireNative.js:1:74)
    at startCore (/nix/store/30i97k1vnv44j23qrw8xix0bh9xyrirs-discord-0.0.22/opt/Discord/resources/app.asar/bootstrap.js:1:1448)
    at EventEmitter.<anonymous> (/nix/store/30i97k1vnv44j23qrw8xix0bh9xyrirs-discord-0.0.22/opt/Discord/resources/app.asar/bootstrap.js:1:2467)
    at Object.onceWrapper (events.js:421:28) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/nix/store/30i97k1vnv44j23qrw8xix0bh9xyrirs-discord-0.0.22/opt/Discord/resources/app.asar/utils/requireNative.js',
    '/nix/store/30i97k1vnv44j23qrw8xix0bh9xyrirs-discord-0.0.22/opt/Discord/resources/app.asar/bootstrap.js',
    '/nix/store/30i97k1vnv44j23qrw8xix0bh9xyrirs-discord-0.0.22/opt/Discord/resources/app.asar/index.js',
    undefined
  ]
} uncaughtException

Steps To Reproduce

Steps to reproduce the behavior:

  1. Install discord with openasar according to wiki
  2. Run discord in terminal

Expected behavior

Discord is launching normally with openasar and opening openasar settings

Screenshots

Output in "Describe the bug"

Additional context

0-0

Notify maintainers

@MP2E @devins2518 @Artturin @Infinidoge

Metadata

[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 5.15.85, NixOS, 22.11 (Raccoon), 22.11.20221230.6a0d270`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.11.1`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`
@Infinidoge
Copy link
Contributor

Hmm,
Given that it's saying it's missing a module in the Discord .config folder, I'm not sure if it's a Nix problem, it might just be that Discord updated and changed things which separately broke OpenAsar.

Will try and build/run on my machine once I'm back on a computer

@dibusure
Copy link
Author

dibusure commented Jan 3, 2023

I'm not sure if it's a Nix problem, it might just be that Discord updated and changed things which separately broke OpenAsar.

I'm sure it is

@Artturin
Copy link
Member

Artturin commented Jan 3, 2023

I'm not sure if it's a Nix problem, it might just be that Discord updated and changed things which separately broke OpenAsar.

I'm sure it is

then have you confirmed that it does not replicate with https://github.com/GooseMod/OpenAsar/wiki/Install-Guide ?

does discord_desktop_core contain these 3 files?

$ ls .config/discord/0.0.22/modules/discord_desktop_core
core.asar  index.js  package.json

@dibusure
Copy link
Author

dibusure commented Jan 3, 2023

does discord_desktop_core contain these 3 files?

i installed via nixpkgs overlay
i said this in "Steps To Reproduce" block

@Artturin
Copy link
Member

Artturin commented Jan 3, 2023

discord downloads its main files to .config/discord at runtime which we can't control

@dibusure
Copy link
Author

dibusure commented Jan 4, 2023

discord downloads its main files to .config/discord at runtime which we can't control

So what can i do?

@Meme-Gawd
Copy link

Run ordinary Discord once (without OpenAsar) so it downloads its main files, then it should run fine with OpenAsar

@Infinidoge
Copy link
Contributor

Hmm. If that is the case, then this does seem to be a flaw with how OpenAsar is handled Nix-side then.
I'm not really sure how that could be fixed, though, outside of trying to run Discord during/before the build to generate the necessary files, which seems... bad.

@dibusure
Copy link
Author

dibusure commented Jan 6, 2023

Run ordinary Discord once (without OpenAsar) so it downloads its main files, then it should run fine with OpenAsar

It helps thanks
I commented strings in nixpkgs.overlays rebuilded, launched discord, then uncommented strings in nixpkgs.overlays, rebuilded and it works
😄

@dibusure dibusure closed this as completed Jan 6, 2023
@sobaq
Copy link

sobaq commented May 14, 2023

IMO this issue should stay open until a workaround is implemented, or this is at least documented somewhere. $VERY_POPULAR_PROGRAM inexplicably breaking every update is pretty poor UX.

@Enzime Enzime reopened this Aug 6, 2023
@Artturin
Copy link
Member

Artturin commented Aug 6, 2023

openasar isn't $VERY_POPULAR_PROGRAM, it's a unsupported mod.

Is there anything nixpkgs specific to do here, or is it a upstream documentation issue.

Anyone can edit the nixos wiki so quirks can be added there.

@Artturin
Copy link
Member

Added workaround instruction to https://nixos.wiki/wiki/Discord#OpenAsar_.2F_Vencord

@Artturin
Copy link
Member

Artturin commented Nov 25, 2023

Maybe there could be a script which launches an unmodified discord when there's an error containing MODULE_NOT_FOUND, but then the discord size will be duplicated. It could print instructions.

@sobaq
Copy link

sobaq commented Nov 26, 2023

openasar isn't $VERY_POPULAR_PROGRAM, it's a unsupported mod.

Is there anything nixpkgs specific to do here, or is it a upstream documentation issue.

Anyone can edit the nixos wiki so quirks can be added there.

I agree, I was wrong. I apologise. I don't think there much more we can do here; Nix pulling discord_desktop_core itself seems too brittle IMO, so this is up to OpenASAR.

@RGBCube
Copy link
Member

RGBCube commented Nov 26, 2023

Maybe there could be a script which launches an unmodified discord when there's an error containing MODULE_NOT_FOUND, but then the discord size will be duplicated. It could print instructions.

Instructuons would be the best solution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants