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

Fix Search Cache compatibility with Electron Apps #823

Merged
merged 3 commits into from
Dec 15, 2020
Merged

Conversation

PrestonN
Copy link
Contributor

The recent change made in v4.1.5 breaks compatibility with Electron based applications. This is because the renderer process within Electron uses a similar library as the one within Node JS, but has small differences to the actual library being used. You can read more about it (and the suggested fix) over at electron/electron#21162.

This change uses the suggested line in the linked issue to specify that setTimeout should use the functionality built into Node instead of the Electron based one.

I've already tested this fix in my project and it seems to work fine with this change.

The recent change made in v4.1.5 breaks compatibility with Electron based applications. This is because the renderer process within Electron uses a similar library as the one within Node JS, but has small differences to the actual library being used. You can read more about it (and the suggested fix) over at [electron/electron#21162](electron/electron#21162).

This change uses the suggested line in the linked issue to specify that `setTimeout` should use the functionality built into Node instead of the Electron based one.

I've already tested this fix in my project and it seems to work fine with this change.
@fent
Copy link
Owner

fent commented Dec 14, 2020

til something new about electron.

thanks for the fix! do you mind adding the same import on info.js? it also uses setTimeout, and although it doesn't use .ref(), i'd like to keep them consistent

@PrestonN
Copy link
Contributor Author

Done!

I actually wasn't aware of this either, so it was weird to see once I noticed the error and started looking up the reason for it.

Everything works without adding the same line to info.js however I went ahead and added it per your request. I also left a comment there for future reference.

@fent
Copy link
Owner

fent commented Dec 15, 2020

thanks!

@fent fent merged commit 6d2b64e into fent:master Dec 15, 2020
@meoyawn
Copy link

meoyawn commented Dec 16, 2020

thanks! this also fixes compat with Cloudflare Workers

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

Successfully merging this pull request may close these issues.

None yet

3 participants