Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Related to the following error:
Details on the actual issue
It looks like any dynamic import will fail once the app is packaged.
To be precise, it fails at the following line https://github.com/nodejs/node/blob/61712651a64fb3d7974d44378af3a4ee1676f287/lib/internal/modules/esm/resolve.js#L648
Skipping the check on the correct path does load the module correctly.
This seems to be related to the function not being able to read the directory within the
.asar
file as an actual path.This is probably generic issue with electron apps from the looks of:
electron/electron#38957
electron/asar#249
Potentially fixed in electron/electron#37535 but this was just barely included in the latest electron 28.0.0 build so I'm reluctant to switch to that.
Solution
We can just replace all dynamic imports with static ones. From what I've read, it won't be that big of a loss
Why wasn't this occurring with the old version?
The dynamic imports were built to
await Promise.resolve().then(() => __importStar(require('axios')));
Baileys/lib/Utils/messages-media.js
Line 233 in acc86e4
await import('axios');
Baileys/lib/Utils/messages-media.js
Line 316 in 0c48c13
I'm not sure what's causing the difference in build results. I assumed maybe my setup changed so I've tried checking out v4.2.0 but it built to the working version