diff --git a/packages/remix-node/sessions/fileStorage.ts b/packages/remix-node/sessions/fileStorage.ts index 0a06213238e..da38f5b16e5 100644 --- a/packages/remix-node/sessions/fileStorage.ts +++ b/packages/remix-node/sessions/fileStorage.ts @@ -42,7 +42,7 @@ export function createFileSessionStorage({ while (true) { // TODO: Once node v16 is available on AWS we should use the webcrypto // API's crypto.getRandomValues() function here instead. - let randomBytes = crypto.randomBytes(8); + let randomBytes = crypto.webcrypto.getRandomValues(new Uint8Array(8)); // This storage manages an id space of 2^64 ids, which is far greater // than the maximum number of files allowed on an NTFS or ext4 volume // (2^32). However, the larger id space should help to avoid collisions