Skip to content

Conversation

@aron
Copy link
Contributor

@aron aron commented Mar 26, 2025

Fixes #273 & #345

The original code was intended to shim in support for the webcrypto interface in Node 18, which was included indirectly as webcrypto in the "node:crypto" module or globally via the --no-experimental-global-webcrypto flag.

This change has caused many issues with bundlers and static analyzers which do not like the obfuscated call to require() see the above tickets.

Node 18 will no longer receive security support as of 30 April 20251 and as such it feels like we can now drop this workaround in favor of documenting the alternative approaches.

The test suite has also been updated to use webcrypto on Node 18.

The original code was intended to shim in support for the webcrypto
interface in Node 18, which was included indirectly as `webcrypto`
in the "node:crypto" module or globally via the
`--no-experimental-global-webcrypto` flag.

This change has caused many issues with bundlers and static analyzers
which do not like the obfuscated call to `require()`.

Node 18 will no longer receive security support as of 30 April 2025[1]
and as such it feels like we can now drop this workaround in favor of
documenting alternative approaches.

[1]: https://endoflife.date/nodejs
@aron aron changed the title remove node crypto Remove attempt to require "node:crypto" on Node 18 Mar 26, 2025
@aron aron force-pushed the remove-node-crypto branch 2 times, most recently from 937058e to 162f294 Compare March 26, 2025 13:22
@aron aron marked this pull request as ready for review March 26, 2025 13:27
@aron aron force-pushed the remove-node-crypto branch from 162f294 to ffbf4fa Compare March 26, 2025 17:02
@aron aron merged commit 37aa363 into main Mar 26, 2025
19 checks passed
@aron aron deleted the remove-node-crypto branch March 26, 2025 17:18
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.

alert message during build "require function is used in a way in which dependencies cannot be statically extracted"

3 participants