Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(react-email): Use the punycode package for the static node modules #1867

Open
wants to merge 3 commits into
base: canary
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/bright-chicken-learn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"react-email": patch
---

use the `punycode` package for the static modules
3 changes: 3 additions & 0 deletions packages/react-email/module-punycode.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
declare module 'module-punycode' {
export * from 'node:punycode';
}
2 changes: 1 addition & 1 deletion packages/react-email/next-env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
/// <reference types="next/image-types/global" />

// NOTE: This file should not be edited
// see https://nextjs.org/docs/app/building-your-application/configuring/typescript for more information.
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
1 change: 1 addition & 0 deletions packages/react-email/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
"framer-motion": "12.0.0-alpha.2",
"postcss": "8.4.40",
"prism-react-renderer": "2.1.0",
"module-punycode": "npm:[email protected]",
"react": "^19",
"react-dom": "^19",
"sharp": "0.33.3",
Expand Down
3 changes: 2 additions & 1 deletion packages/react-email/src/utils/static-node-modules-for-vm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import os from 'node:os';
import path from 'node:path';
import perfHooks from 'node:perf_hooks';
import process from 'node:process';
import punycode from 'node:punycode';
import querystring from 'node:querystring';
import readline from 'node:readline';
import repl from 'node:repl';
Expand All @@ -40,6 +39,8 @@ import v8 from 'node:v8';
import vm from 'node:vm';
import workerThreads from 'node:worker_threads';
import zlib from 'node:zlib';
// See https://github.com/resend/react-email/issues/1841#issuecomment-2589985562
import punycode from 'module-punycode';

/**
* A map of the name of the modules (including `node:` prefixed ones)
Expand Down
3 changes: 3 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading