Skip to content

@clerk/remix v4.0.12 RequestInit: duplex option is required when sending a body. #3440

Description

@jtparrett

Preliminary Checks

Reproduction

https://github.com/jtparrett/rcdriftuk-website

Publishable key

pk_live_Y2xlcmsucmNkcmlmdC51ayQ

Description

This issue only happens in production on vercel, this issue DOES NOT HAPPEN LOCALLY.

I have included the production repo just because the issue only happens in production on vercel.

The problem is with any remix action that uses getAuth() will give the error below regarding a duplex option on the body.

The error happens when using node 20 or node 18. I've also tried updating every possible package.

Please see file: app/routes/events.$id.tsx -> action

Steps to reproduce:

  1. Create a remix action which uses getAuth()
  2. Fire the action using a remix component

Expected behavior:
The getAuth method should return the user

Actual behavior:
The getAuth method has the following error

TypeError: RequestInit: duplex option is required when sending a body.
    at new Request (node:internal/deps/undici/undici:5096:19)
    at new ClerkRequest (/var/task/node_modules/@clerk/backend/dist/internal.js:2273:5)
    at createClerkRequest (/var/task/node_modules/@clerk/backend/dist/internal.js:2313:54)
    at loadOptions (/var/task/node_modules/@clerk/remix/dist/ssr/loadOptions.js:34:63)
    at getAuth (/var/task/node_modules/@clerk/remix/dist/ssr/getAuth.js:32:60)
    at action5 (file:///var/task/build/index.js:3030:26)
    at Object.callRouteAction (/var/task/node_modules/@remix-run/server-runtime/dist/data.js:37:22)
    at commonRoute.action (/var/task/node_modules/@remix-run/server-runtime/dist/routes.js:63:69)
    at actualHandler (/var/task/node_modules/@remix-run/router/dist/router.cjs.js:4218:14)
    at /var/task/node_modules/@remix-run/router/dist/router.cjs.js:4230:27

Environment

System:
    OS: macOS 14.3
    CPU: (8) arm64 Apple M2
    Memory: 71.30 MB / 8.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.11.0 - ~/.nvm/versions/node/v20.11.0/bin/node
    npm: 10.2.4 - ~/.nvm/versions/node/v20.11.0/bin/npm
  Browsers:
    Chrome: 125.0.6422.76
    Safari: 17.3
  npmPackages:
    @clerk/remix: ^4.0.12 => 4.0.12 
    @clerk/themes: ^2.1.2 => 2.1.2 
    @pandacss/dev: ^0.38.0 => 0.38.0 
    @prisma/client: ^5.9.1 => 5.13.0 
    @remix-run/css-bundle: ^2.9.2 => 2.9.2 
    @remix-run/dev: ^2.9.2 => 2.9.2 
    @remix-run/eslint-config: ^2.9.2 => 2.9.2 
    @remix-run/node: ^2.9.2 => 2.9.2 
    @remix-run/react: ^2.9.2 => 2.9.2 
    @remix-run/serve: ^2.9.2 => 2.9.2 
    @types/leaflet: ^1.9.4 => 1.9.12 
    @types/pluralize: ^0.0.33 => 0.0.33 
    @types/react: ^18.2.20 => 18.3.1 
    @types/react-dom: ^18.2.7 => 18.3.0 
    @vercel/analytics: ^1.1.1 => 1.2.2 
    date-fns: ^2.30.0 => 2.30.0 
    eslint: ^8.38.0 => 8.57.0 
    isbot: ^3.6.8 => 3.8.0 
    leaflet: ^1.9.4 => 1.9.4 
    pluralize: ^8.0.0 => 8.0.0 
    prisma: ^5.9.1 => 5.13.0 
    react: ^18.2.0 => 18.3.1 
    react-dom: ^18.2.0 => 18.3.1 
    react-icons: ^5.0.1 => 5.2.0 
    react-leaflet: ^4.2.1 => 4.2.1 
    react-markdown: ^9.0.1 => 9.0.1 
    react-tiny-popover: ^8.0.4 => 8.0.4 
    tiny-invariant: ^1.3.1 => 1.3.3 
    typescript: ^5.1.6 => 5.4.5 
    zod: ^3.22.4 => 3.23.6

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions