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

fix(remix): Fix issue where request body has already been read #3839

Conversation

octoper
Copy link
Member

@octoper octoper commented Jul 29, 2024

Description

This PR fixes a bug where the body has already been read and we try to clone the whole request and this results to an error.

Fixes #3769

Checklist

  • npm test runs as expected.
  • npm run build runs as expected.
  • (If applicable) JSDoc comments have been added or updated for any package exports
  • (If applicable) Documentation has been updated

Type of change

  • 🐛 Bug fix
  • 🌟 New feature
  • 🔨 Breaking change
  • 📖 Refactoring / dependency upgrade / documentation
  • other:

Copy link

changeset-bot bot commented Jul 29, 2024

🦋 Changeset detected

Latest commit: 3aaf608

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@clerk/remix Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@octoper octoper self-assigned this Jul 29, 2024
@octoper octoper requested a review from anagstef July 29, 2024 18:12
@octoper
Copy link
Member Author

octoper commented Jul 29, 2024

!snapshot

@octoper octoper requested a review from wobsoriano July 29, 2024 18:12
@octoper octoper requested review from LekoArts and dimkl July 29, 2024 18:12
@octoper octoper changed the title fix(remix): Fix issue where request body has already been read fix(remix): Fix issue where request body has already been read Jul 29, 2024
@clerk-cookie
Copy link
Collaborator

Hey @octoper - the snapshot version command generated the following package versions:

Package Version
@clerk/astro 1.0.5-snapshot.vb3a15ea
@clerk/backend 1.5.0-snapshot.vb3a15ea
@clerk/chrome-extension 1.1.8-snapshot.vb3a15ea
@clerk/clerk-js 5.10.3-snapshot.vb3a15ea
@clerk/elements 0.10.8-snapshot.vb3a15ea
@clerk/clerk-expo 2.0.1-snapshot.vb3a15ea
@clerk/express 0.0.22-snapshot.vb3a15ea
@clerk/fastify 1.0.24-snapshot.vb3a15ea
gatsby-plugin-clerk 5.0.0-beta.45
@clerk/localizations 2.5.3-snapshot.vb3a15ea
@clerk/nextjs 5.2.9-snapshot.vb3a15ea
@clerk/remix 4.2.8-snapshot.vb3a15ea
@clerk/clerk-sdk-node 5.0.21-snapshot.vb3a15ea
@clerk/tanstack-start 0.1.12-snapshot.vb3a15ea
@clerk/testing 1.2.4-snapshot.vb3a15ea

Tip: Use the snippet copy button below to quickly install the required packages.
@clerk/astro

npm i @clerk/astro@1.0.5-snapshot.vb3a15ea --save-exact

@clerk/backend

npm i @clerk/backend@1.5.0-snapshot.vb3a15ea --save-exact

@clerk/chrome-extension

npm i @clerk/chrome-extension@1.1.8-snapshot.vb3a15ea --save-exact

@clerk/clerk-js

npm i @clerk/clerk-js@5.10.3-snapshot.vb3a15ea --save-exact

@clerk/elements

npm i @clerk/elements@0.10.8-snapshot.vb3a15ea --save-exact

@clerk/clerk-expo

npm i @clerk/clerk-expo@2.0.1-snapshot.vb3a15ea --save-exact

@clerk/express

npm i @clerk/express@0.0.22-snapshot.vb3a15ea --save-exact

@clerk/fastify

npm i @clerk/fastify@1.0.24-snapshot.vb3a15ea --save-exact

gatsby-plugin-clerk

npm i gatsby-plugin-clerk@5.0.0-beta.45 --save-exact

@clerk/localizations

npm i @clerk/localizations@2.5.3-snapshot.vb3a15ea --save-exact

@clerk/nextjs

npm i @clerk/nextjs@5.2.9-snapshot.vb3a15ea --save-exact

@clerk/remix

npm i @clerk/remix@4.2.8-snapshot.vb3a15ea --save-exact

@clerk/clerk-sdk-node

npm i @clerk/clerk-sdk-node@5.0.21-snapshot.vb3a15ea --save-exact

@clerk/tanstack-start

npm i @clerk/tanstack-start@0.1.12-snapshot.vb3a15ea --save-exact

@clerk/testing

npm i @clerk/testing@1.2.4-snapshot.vb3a15ea --save-exact

Copy link
Member

@wobsoriano wobsoriano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me. I initially wondered why cloning the request wasn't sufficient, but I realized that it's possible to read the request in userland before passing it to the getAuth helper

@LekoArts LekoArts merged commit f20b0cd into main Jul 30, 2024
18 checks passed
@LekoArts LekoArts deleted the vaggelis/eco-105-duplex-changes-in-remix-prevent-calling-getauth-after-body branch July 30, 2024 10:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Duplex Changes in Remix prevent calling getAuth after body already is read
6 participants