Skip to content

Commit

Permalink
fix:Crypto works under node18
Browse files Browse the repository at this point in the history
  • Loading branch information
nojiritakeshi committed Feb 9, 2025
1 parent 6a3e35e commit ce63d44
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/fifty-parrots-retire.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@opennextjs/cloudflare": patch
---

Crypto does not generate errors even when node version is less than 18.
5 changes: 4 additions & 1 deletion packages/cloudflare/src/cli/utils/ask-confirmation.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
// TODO: Drop this file when Node.js 18 is deprecated
import { randomUUID } from "node:crypto";

import Enquirer from "enquirer";

export async function askConfirmation(message: string): Promise<boolean> {
const questionName = crypto.randomUUID();
const questionName = randomUUID();

const enquirerAnswersObject = await Enquirer.prompt<Record<string, boolean>>({
name: questionName,
Expand Down

0 comments on commit ce63d44

Please sign in to comment.