Comments (12)
@jtparrett I have found a way around the issue in case you are interested.
I thought it was weird that in the loader it works but not in the action,
So I dived inside Clerk code and realized they kind of piggy bag on our request.
So I tried to recreate a request that should work basically like in Loaders a get request with headers as this is where the Auth information is saved.
const generateNewRequestForClerk = (request: Request) => {
const originalRequest = request.clone();
const newRequestInit = {
method: "GET", // Change the method to GET
headers: new Headers(originalRequest.headers), // Copy headers from the original request
};
// Remove content-type header as it's not needed for GET and may cause issues
newRequestInit.headers.delete("Content-Type");
// Instantiate the new request without the body attribute
return new Request(originalRequest.url, newRequestInit);
};
const auth = await getAuth({
...args,
request: generateNewRequestForClerk(args.request),
});
Try it out and please tell me if it is working on your side too? 🙏
from javascript.
This was fixed with #3495 👍
from javascript.
Hello. I'm using clerk/remix on Cloudflare Pages, and when using getAuth
within an ActionFunction, it seems to generate a new error from the code that was fixed in the PR #3495 🤔 The workaround provided seems to prevent the error from occurring.
TypeError: Cannot set property duplex of #<_Request> which has only a getter
at patchRequest (.../node_modules/@clerk/remix/dist/ssr/utils.js:115:26)
from javascript.
Hey!
We have released a fix for the regression that was introduced in #3495, you can upgrade to the latest version of the Remix SDK and it will be resolved!
from javascript.
briardg
Thanks for this! Yes, that fix also worked in my case 👍 using it as a workaround for now.
from javascript.
@briardg thank you for the workaround, worked well on my end too
from javascript.
Hello,
I have the same issue, and it is not happening inside the Remix Loader but only in the action.
My version of node is the same.
I also added the Vercel recommendation using @vercel/remix instead of @remix-run/node
and vite config import { vercelPreset } from "@vercel/remix/vite";
But nothing helped
from javascript.
@octoper will look into this!
from javascript.
@octoper will look into this!
I can be available for any live coding meeting if needed
from javascript.
Hello. I'm using clerk/remix on Cloudflare Pages, and when using
getAuth
within an ActionFunction, it seems to generate a new error from the code that was fixed in the PR #3495 🤔 The workaround provided seems to prevent the error from occurring.TypeError: Cannot set property duplex of #<_Request> which has only a getter at patchRequest (.../node_modules/@clerk/remix/dist/ssr/utils.js:115:26)
I just started a new project two days ago and I get the same error running on regular Node.js.
from javascript.
This was fixed with #3495 👍
But this unfortunately introduced a regression. Discussion on Discord here https://discord.com/channels/856971667393609759/1253975184818573313
@arminnaimi I have reported this bug. Hopefully they will fix it soon. In the meantime you can just downgrade to the previous version of @clerk/remix.
from javascript.
Thanks you for reporting that I will take a look at it today!
from javascript.
Related Issues (20)
- WebView not opening Remix app webpage as authenticated when navigating from Expo app HOT 1
- Clerk causes hydration errors when used with Remix's streaming (`defer()`). HOT 2
- New UserButton.MenuItems component causing error HOT 3
- @clerk/astro: Uncaught (in promise) Clerk: Failed find clerk-js script HOT 1
- clerk-expo now always requires installing expo-local-authentication HOT 6
- Clerk Components RTL Problems HOT 1
- ReferenceError: Request is not defined HOT 3
- Constantly getting redirection from clerk in Next app HOT 7
- e.clearFeedback is not a function. (In 'e.clearFeedback()', 'e.clearFeedback' is undefined) HOT 3
- clerk-expo is throwing `TypeError: window.addEventListener is not a function (it is undefined), js engine: hermes` HOT 9
- Cannot Use redirectToSignIn Method in @clerk/nextjs HOT 2
- UserResource types are in disagreement in `@clerk/clerk-expo` and `@clerk/types` in version 2.2.5 HOT 6
- Facing Nextjs Relative URL Issues in Next.js Middleware with tRPC on Edge Runtime (Cloudflare)
- Webhook Not Triggering on Clerk OAuth User Creation
- `clerk-js`'s `__unstable__updateProps` does nothing for UserButton HOT 2
- Having a complex Astro config throws "Converting circular structure to JSON" when using Clerk components. HOT 5
- Stale auth after succesful sign-in HOT 1
- Introduction of EIP6963 broke any alternative wallet extensions other than Metamask HOT 2
- Unable to resolve module @clerk/shared/authorization HOT 4
- Issue in @clerk/[email protected] HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from javascript.