Skip to content

TypeError: Cannot read properties of undefined (reading 'current') when adding --turbo #57936

@pjborowiecki

Description

@pjborowiecki

Link to the code that reproduces this issue

https://github.com/pjborowiecki/PERSONAL-PORTFOLIO-Next14-Sanity-TypeScript-GSAP-Tailwind

To Reproduce

  1. Fill in the RESEND_API_KEY, RESEND_EMAIL_FROM, and RESEND_EMAIL_TO environment variables in .env file
  2. Start the application without turbo and attempt to use the contact form (works perfectly fine)
  3. Add --turbo to your dev script in package.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

  • I verified that the issue exists in the latest Next.js 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    TurbopackRelated to Turbopack with Next.js.bugIssue was opened via the bug report template.linear: turbopackConfirmed issue that is tracked by the Turbopack team.locked

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions