resend / resend-node

Resend's Official Node.js SDK
MIT License
555 stars 41 forks source link

Fix for updating to Next 14.0 #244

Closed martinez-hugo closed 11 months ago

martinez-hugo commented 11 months ago

Hello !

I've just update my project to Next v14 but I had this error generated by upgrading :

Failed to compile.
--
08:53:51.047 |  
08:53:51.047 | ./node_modules/@react-email/render/dist/index.mjs
08:53:51.048 | Attempted import error: 'renderToReadableStream' is not exported from 'react-dom/server' (imported as 'renderToReadableStream').
08:53:51.048 |  
08:53:51.048 | Import trace for requested module:
08:53:51.048 | ./node_modules/@react-email/render/dist/index.mjs
08:53:51.048 | ./node_modules/resend/build/src/resend.js
08:53:51.048 | ./node_modules/resend/build/src/index.js
08:53:51.048 | ./src/app/api/send/route.tsx

Do you think that you can fix this error on your package ?

Thanks for all

zenorocha commented 11 months ago

just so you all know, we're currently working on adding support for Next 14

russelh15 commented 11 months ago

Any updates on this?

T04435 commented 11 months ago

I have updated to "resend": "^2.0.0-canary.0", and it is fixed.

When can we have a stable v2?

bukinoshita commented 11 months ago

We didn't find a fix for react-email render yet, but still working on this. The resend@2.0.0-canary.0 uses the @react-email/render@v0.0.9-canary.0 version which fixes the issue for Next.js 14, but breaks for Next.js 13. Once we fix that issue for both versions, we're going to update the Resend package.

bukinoshita commented 11 months ago

For reference, our tests with React Email passed with the latest canary version (https://github.com/resendlabs/react-email/issues/989#issuecomment-1787746290). We'll be working on comparability with Resend now

KingXP-Pythoner commented 11 months ago

I'm not using the render/renderAsync functions and still running into the issue. I've also tried resend@2.0.0-canary.0

bukinoshita commented 11 months ago

I'm not using the render/renderAsync functions and still running into the issue. I've also tried resend@2.0.0-canary.0

Can you share your setup and how you're doing? I can include in the tests once I start working on the resend-node

bukinoshita commented 11 months ago

I'm not using the render/renderAsync functions and still running into the issue. I've also tried resend@2.0.0-canary.0

Can you try the 2.0.0-canary.2?

T04435 commented 11 months ago

@bukinoshita Tested with 2.0.0-canary.2 it also works.

in terms of setup:

all our packages are close to latest version(weekly updated)

KingXP-Pythoner commented 11 months ago

I'm not using the render/renderAsync functions and still running into the issue. I've also tried resend@2.0.0-canary.0

Can you share your setup and how you're doing? I can include in the tests once I start working on the resend-node

Hi, thanks for the response, I just tried with 2.0.0-canary.2 and it didn't work then i realised the @react-email/components was outdated so i updated that and it works now! Thanks a lot

Jordaneisenburger commented 11 months ago

@bukinoshita the resend@2.0.0-canary.2 version fixed the issue for me, thanks a lot!

T04435 commented 11 months ago

@bukinoshita 👍🏼

petergombos commented 10 months ago

Works fine in api routes but it fails in Server actions:

Screenshot 2023-11-19 at 21 54 59 Screenshot 2023-11-19 at 21 45 44
Heechem commented 10 months ago

this issue is still not fixed , I have the error with "@"resend": "^2.0.0-canary.2", and "@react-email/render": "^0.0.9-canary.0",

I will take off this library and use another thing , my page dosent work

image

YuBenhao commented 9 months ago

We didn't find a fix for react-email render yet, but still working on this. The resend@2.0.0-canary.0 uses the @react-email/render@v0.0.9-canary.0 version which fixes the issue for Next.js 14, but breaks for Next.js 13. Once we fix that issue for both versions, we're going to update the Resend package.

Works for me!