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

v3.3.0 is throwing an error #381

Closed
mfts opened this issue Jun 15, 2024 · 8 comments
Closed

v3.3.0 is throwing an error #381

mfts opened this issue Jun 15, 2024 · 8 comments

Comments

@mfts
Copy link

mfts commented Jun 15, 2024

I saw that v3.3.0 was made available through npm even though there are no release notes here on GitHub.

It broke my email sending capability with next@14.2.4.

here's the error which goes back to @react-email/render@0.0.15 bumped from the prev v0.0.12

Error: Dynamic require of "stream" is not supported
    at file:///Users/mfts/dev/mfts/papermark-main/node_modules/@react-email/render/dist/index.mjs:22:9
    at file:///Users/mfts/dev/mfts/papermark-main/node_modules/@react-email/render/dist/index.mjs:104:26
    at Generator.next (<anonymous>)
    at file:///Users/mfts/dev/mfts/papermark-main/node_modules/@react-email/render/dist/index.mjs:41:61
    at new Promise (<anonymous>)
    at __async (file:///Users/mfts/dev/mfts/papermark-main/node_modules/@react-email/render/dist/index.mjs:25:10)
    at readStream (file:///Users/mfts/dev/mfts/papermark-main/node_modules/@react-email/render/dist/index.mjs:94:30)
    at file:///Users/mfts/dev/mfts/papermark-main/node_modules/@react-email/render/dist/index.mjs:133:26
    at Generator.next (<anonymous>)
    at file:///Users/mfts/dev/mfts/papermark-main/node_modules/@react-email/render/dist/index.mjs:41:61
    at new Promise (<anonymous>)
    at __async (file:///Users/mfts/dev/mfts/papermark-main/node_modules/@react-email/render/dist/index.mjs:25:10)
    at onAllReady (file:///Users/mfts/dev/mfts/papermark-main/node_modules/@react-email/render/dist/index.mjs:132:18)
    at finishedTask (/Users/mfts/dev/mfts/papermark-main/node_modules/react-dom/cjs/react-dom-server.node.development.js:6579:5)
    at retryTask (/Users/mfts/dev/mfts/papermark-main/node_modules/react-dom/cjs/react-dom-server.node.development.js:6609:5)
@vasco3
Copy link

vasco3 commented Jun 17, 2024

I'm also geetting an error when upgrading from resend v3.2 to 3.3.

sending email from convex.dev with resend.com and react-email, i upgraded to latest version and now it throwing this error "Uncaught TypeError: reactDOMServer.renderToPipeableStream is not a function
    at __spreadValues11.selectors (../../../node_modules/.pnpm/@react-email+render@0.0.15/node_modules/@react-email/render/dist/index.mjs:130:21)
    at new Promise (<anonymous>)
    at <anonymous> (../../../node_modules/.pnpm/@react-email+render@0.0.15/node_modules/@react-email/render/dist/index.mjs:129:6)
    at next [as next] (<anonymous>)
    at fulfilled (../../../node_modules/.pnpm/@react-email+render@0.0.15/node_modules/@react-email/render/dist/index.mjs:28:8)"

deps

  • resend v3.3
  • node v21.6.0
  • "@react-email/components": "0.0.19",
  • "@react-email/tailwind": "0.0.18",
  • "react-email": "2.1.4",

@xixixao
Copy link

xixixao commented Jun 24, 2024

What @vasco3 is reporting was broken by resend/react-email#1117 cc @gabrielmfern , specifically the change in packages/render/src/render-async.ts from:

const reactDOMServer = (await import("react-dom/server")).default;

to

const reactDOMServer = await import("react-dom/server");
const renderToStream = Object.hasOwn(reactDOMServer, "renderToReadableStream")

When I test this in our environment, "react-dom/server" has only the default export, which has all the methods. Hence @react-email/render@0.0.15 is broken for us (Convex runs our own runtime wrapping V8), and potentially for others, and so is resend@3.3.0.

The Convex runtime matches the browser condition, so I expect others matching the condition to be broken too.

@gabrielmfern
Copy link
Contributor

gabrielmfern commented Jun 24, 2024

This is because of the issue mentioned in resend/react-email#1486 which has been fixed on React Email's canary, so a workaround should be adding an override for it, like what was mentioned in resend/react-email#1486 (comment):

  "overrides": {
    "resend": {
      "@react-email/render": "0.0.16-canary.0"
    }
  },

@isMattCoding
Copy link

I'm using yarn, and the overrides section in the package.json wasn't overriding the dependency.
I figured out I could use:

"resolutions": {
    "resend/@react-email/render": "0.0.16-canary.0"
  },

@mfts
Copy link
Author

mfts commented Jun 29, 2024

This is because of the issue mentioned in resend/react-email#1486 which has been fixed on React Email's canary, so a workaround should be adding an override for it, like what was mentioned in resend/react-email#1486 (comment)

Thanks @gabrielmfern I understand that the packages are related. But it's pretty bad DX when I upgrade resend to 3.3.0 and it breaks and there's no mention of this workaround or possibility of breaking in the resend changelog.

Great that there's a workaround but maybe it should be part of a patch update to resend.


Also I just noticed that 3.3.0 wasn't even officially released on github (weird?). image

@isMattCoding
Copy link

Since @react-email/render@0.0.16 has been released, this should be resolved as soon as #395 is merged and released

@RodrigoVila
Copy link

Since @react-email/render@0.0.16 has been released, this should be resolved as soon as #395 is merged and released

Any update on this? have the same problem and the workarounds don't work for me :(. I see PR #395 is merged but I think it's not released yet.

Thanks!!

@vcapretz
Copy link
Member

hey there, we just released v4.0.1, which bumps the dependency of react-email/render to v1 and hopefully makes the issues go away 🙏

I'm closing the issue but please feel free to either re-open or comment if you see anything! thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants