-
Notifications
You must be signed in to change notification settings - Fork 27k
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
TypeError: Cannot read properties of undefined (reading 'current') when adding --turbo
#57936
Comments
Have you tried to debug the issue, if so, what have you discovered thus far ? |
The error message is not very descriptive. It looks something like this:
.. and so on. Mentioned it here for others, and to make Next.js and Resend maintainers aware of this issue. Thank you for the answer |
Ok give me sometime, will try to reproduce this on my end. Will update you in a few hours. |
@pjborowiecki I think i need some environment variables to reproduce this. Maybe i just need the projectId ? i added test I get body: {
message: 'Dataset "production" not found for project ID "test"',
statusCode: 404,
error: 'Dataset not found'
}, I think i can add random values for the following, or maybe im wrong.
|
@pjborowiecki do you have more instructions on how to properly reproduce this issue? |
I was able to reproduce when using |
I'm having this exact same issue. I had to move back to Webpack again to be able to develop my app. |
Would definitely appreciate a more minimal repro @r4zendev |
@ForsakenHarmony that's about as minimal as I could get: https://github.com/r4zendev/turbo-repro If you setup your own Resend configuration and try to send the email, it would fail with an error printed out in the console that is similar to the OP's. The same works flawlessly with Webpack. To setup provide a valid resend api key in |
Getting the same error, in the same place. |
Also ran into this issue with resend and react mail. However, when using html in the mail headers it works does not work: const data = await resend.emails.send({
from: "onboarding@resend.dev",
to: "test@hotmail.com",
subject: `has a message!`,
react: NotionMagicLinkEmail({ loginCode: "123456" }),
}) does work: const data = await resend.emails.send({
from: "onboarding@resend.dev",
to: "test@hotmail.com",
subject: `has a message!`,
html: "<p>Hello world!</p>",
}) |
For what it's worth, I got the exact same error when using resend with the |
Seeing the same issue. Runs fine without --turbo. But running with --turbo (Next 14.1) causes TypeError: Cannot read properties of undefined (reading 'current'). |
Experiencing the same issues with --turbo flag on Next 14.1.0. Both Resend and ZeptoMail result to TypeError: Cannot read properties of undefined (reading 'current') however without the --turbo flag everything works fine no errors thrown |
### What? Probably not the right solution, next.js disables the `react-server` import condition in there somehow I think ### Why? Resend uses `@react-email/render` which uses `renderToString` from `react-dom/server`. Unfortunately importing `react-dom/server` with the `react-server` import condition leads to a broken bundle (which seems like a bug in react?). Closes PACK-2243 Fixes #57936
This closed issue has been automatically locked because it had no new activity for 2 weeks. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Link to the code that reproduces this issue
https://github.com/pjborowiecki/PERSONAL-PORTFOLIO-Next14-Sanity-TypeScript-GSAP-Tailwind
To Reproduce
RESEND_API_KEY
,RESEND_EMAIL_FROM
, andRESEND_EMAIL_TO
environment variables in.env
file--turbo
to your dev script inpackage.json
, attempt to use the form (and see it logging out the error)Current vs. Expected behavior
Expecting no errors when submitting a form using Resend and
--turbo
Verify canary release
Provide environment information
Operating System: Platform: darwin Arch: arm64 Version: Darwin Kernel Version 22.5.0: Mon Apr 24 20:53:44 PDT 2023; root:xnu-8796.121.2~5/RELEASE_ARM64_T8103 Binaries: Node: 18.17.0 npm: 10.2.2 Yarn: 1.22.19 pnpm: 8.10.0 Relevant Packages: next: 14.0.2-canary.6 eslint-config-next: 14.0.1 react: 18.2.0 react-dom: 18.2.0 typescript: 5.2.2 Next.js Config: output: N/A
Which area(s) are affected? (Select all that apply)
Turbopack (--turbo)
Additional context
I have been working on my personal portfolio website and set up a contact form with React Hook Form, Resend, and Server Actions.
It works perfectly fine, even after upgrading to Next 14. However, the moment I add --turbo to the dev script, it no longer submits the emails. The action fails with the message:
TypeError: cannot read properties of undefined (reading 'current')
.The project is completely unstyled yet for larger screens, I am currently working on styling for mobile devices, so please do not get outraged. Styling is irrelevant to the issue.
PACK-2243
The text was updated successfully, but these errors were encountered: