diff --git a/node_modules/serialize-javascript/index.js b/node_modules/serialize-javascript/index.js
index e298ab4..6260660 100644
--- a/node_modules/serialize-javascript/index.js
+++ b/node_modules/serialize-javascript/index.js
@@ -6,6 +6,9 @@ See the accompanying LICENSE file for terms.
 
 'use strict';
 
+// Node 18: global.crypto not available; use require('crypto').webcrypto (patched for Node 18 compatibility)
+var crypto = (typeof global !== 'undefined' && global.crypto) || (typeof globalThis !== 'undefined' && globalThis.crypto) || require('crypto').webcrypto;
+
 // Generate an internal UID to make the regexp pattern harder to guess.
 var UID_LENGTH          = 16;
 var UID                 = generateUID();
