Skip to content

Commit c61760e

Browse files
authored
chore(react-email): Use the punycode package for the static node modules (#1867)
1 parent 5f1828b commit c61760e

File tree

5 files changed

+14
-1
lines changed

5 files changed

+14
-1
lines changed

.changeset/bright-chicken-learn.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"react-email": patch
3+
---
4+
5+
use the `punycode` package for the static modules
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
declare module 'module-punycode' {
2+
export * from 'node:punycode';
3+
}

packages/react-email/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@
6161
"framer-motion": "12.0.0-alpha.2",
6262
"postcss": "8.4.40",
6363
"prism-react-renderer": "2.1.0",
64+
"module-punycode": "npm:[email protected]",
6465
"react": "^19",
6566
"react-dom": "^19",
6667
"sharp": "0.33.3",

packages/react-email/src/utils/static-node-modules-for-vm.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ import os from 'node:os';
2323
import path from 'node:path';
2424
import perfHooks from 'node:perf_hooks';
2525
import process from 'node:process';
26-
import punycode from 'node:punycode';
2726
import querystring from 'node:querystring';
2827
import readline from 'node:readline';
2928
import repl from 'node:repl';
@@ -40,6 +39,8 @@ import v8 from 'node:v8';
4039
import vm from 'node:vm';
4140
import workerThreads from 'node:worker_threads';
4241
import zlib from 'node:zlib';
42+
// See https://github.com/resend/react-email/issues/1841#issuecomment-2589985562
43+
import punycode from 'module-punycode';
4344

4445
/**
4546
* A map of the name of the modules (including `node:` prefixed ones)

pnpm-lock.yaml

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)