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

Error using pagecrypt with Node 19 #34

Closed
metonym opened this issue Oct 27, 2022 · 2 comments · Fixed by #35
Closed

Error using pagecrypt with Node 19 #34

metonym opened this issue Oct 27, 2022 · 2 comments · Fixed by #35

Comments

@metonym
Copy link
Contributor

metonym commented Oct 27, 2022

Ref: render-examples/pagecrypt#1

Node version 19 was released last week, and there appears to be a difference in how the loadCrypto function is evaluated.

In Node 16, for example, this condition is not evaluated and crypto is loaded dynamically. However, in Node 19, it appears that the condition is evaluated, producing the ReferenceError: window is not defined message. I'm unsure if this is a bug in Node 19 or if it's an intentional breaking change.

This is the output when running the CLI using Node 19:

file:///Users/pagecrypt/cli.js:16
const crypto2 = window.crypto || globalThis.crypto;
                    ^
ReferenceError: window is not defined
@Greenheart
Copy link
Owner

@metonym This fix is now available in pagecrypt 6.0.0 :)

@metonym
Copy link
Contributor Author

metonym commented Dec 27, 2022

Awesome, thanks!

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 a pull request may close this issue.

2 participants