Ryan
TTCTheo's Typesafe Cult
•Created by Ryan on 11/16/2024 in #questions
Error: The string to be decoded is not correctly encoded when using @clerk/nextjs in Next.js 15.0.3
I’m running into an issue while setting up a Next.js app (v15.0.3) with u/clerk/nextjs. When I try to run the development server, the app compiles but fails with the following error:
Key Details:
Stack:
Next.js version: 15.0.3
@clerk/nextjs version: Latest (as of this post).
Environment Setup:
Running locally with Docker.
.env includes keys like NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY and CLERK_SECRET_KEY (see below).
Files for Context:
layout.tsx:
next.config.js:
.env:
docker-compose.yaml:
Dockerfile
What I’ve Tried:
Verified environment variables are correctly set.
Reinstalled all dependencies.
Confirmed the Clerk keys are correct for my development environment.
Could this be related to the way environment variables are passed or the server-side setup? Any debugging tips for narrowing down where this string decoding error is happening? Thanks in advance for your help! Let me know if you need more details
Could this be related to the way environment variables are passed or the server-side setup? Any debugging tips for narrowing down where this string decoding error is happening? Thanks in advance for your help! Let me know if you need more details
2 replies
TTCTheo's Typesafe Cult
•Created by Ryan on 10/1/2023 in #questions
Parameter 'props' implicitly has an 'any' type
8 replies
TTCTheo's Typesafe Cult
•Created by Ryan on 9/18/2023 in #questions
Any idea how to use imports outside of a module? Trouble understanding this error:
33 replies
TTCTheo's Typesafe Cult
•Created by Ryan on 9/17/2023 in #questions
ReferenceError Help in next13
21 replies
TTCTheo's Typesafe Cult
•Created by Ryan on 9/15/2023 in #questions
React components in my contentlayer MDX blog not rendering
4 replies
TTCTheo's Typesafe Cult
•Created by Ryan on 9/13/2023 in #questions
Next seems to not be respecting the layout.tsx
14 replies
TTCTheo's Typesafe Cult
•Created by Ryan on 9/13/2023 in #questions
React components not rendering in mdx (contentlayer)
7 replies
TTCTheo's Typesafe Cult
•Created by Ryan on 9/12/2023 in #questions
question about spread operator in react
7 replies
TTCTheo's Typesafe Cult
•Created by Ryan on 8/28/2023 in #questions
Help getting my login button to redirect the user
3 replies
TTCTheo's Typesafe Cult
•Created by Ryan on 8/27/2023 in #questions
Unhandled Runtime ErrorRangeError: Maximum call stack size exceeded
4 replies
TTCTheo's Typesafe Cult
•Created by Ryan on 8/23/2023 in #questions
error with this prisma delete request?
11 replies
TTCTheo's Typesafe Cult
•Created by Ryan on 8/19/2023 in #questions
How to implement session-based auth in NextJS13 without services like Nextauth/clerk/supabase etc
I want to have session based authentication for my small SaaS prototype side projects, and I want to just make it without having to worry about inescapable tradeoffs or breaking updates of auth services.
The thing is, I don't know enough about security/networking practices to understand exactly all the bases I need to cover. Like cross-site-request-forgery etc I have no idea about how to take precaution against. I also don't know the go-to libraries for creating cookies and storing cookies on the client or how any of that works. Does anyone have any resources or experience making auth from scratch in next13 that they could share on how to do something like this? Or is this path even recommended if my goal is to just quickly build, iterate, and market SaaS applications as a solo developer? Thanks.
The thing is, I don't know enough about security/networking practices to understand exactly all the bases I need to cover. Like cross-site-request-forgery etc I have no idea about how to take precaution against. I also don't know the go-to libraries for creating cookies and storing cookies on the client or how any of that works. Does anyone have any resources or experience making auth from scratch in next13 that they could share on how to do something like this? Or is this path even recommended if my goal is to just quickly build, iterate, and market SaaS applications as a solo developer? Thanks.
2 replies
TTCTheo's Typesafe Cult
•Created by Ryan on 8/19/2023 in #questions
error passing props to client component?
5 replies
TTCTheo's Typesafe Cult
•Created by Ryan on 8/18/2023 in #questions
Noob question: How to pass a string to a child component?
I used prisma to get two strings from a database, now I want to give those two strings to a client component. This is because client components cant use prisma.
I'm new to react, how can I pass these strings to the client component? I'm thinking something like this: and then the main page.tsx would have like: How should I do this? This has been taking an embarrassing amount of time trying to figure out.
I'm new to react, how can I pass these strings to the client component? I'm thinking something like this: and then the main page.tsx would have like: How should I do this? This has been taking an embarrassing amount of time trying to figure out.
18 replies
TTCTheo's Typesafe Cult
•Created by Ryan on 8/17/2023 in #questions
How to automatically sign-in user in after they click a verify email link sent to their email inbox?
Once a user registers an account, the page prompts them to click the link in the email sent to them. How can I make that link automatically log them in? Is this possible, or would they still have to log in manually after verifying their email? One idea i had was to "pseudo" sign them in upon registration, and then them clicking on the verify link re-validates the registration page, giving them full access.
Is there a better way to do this?
Is there a better way to do this?
25 replies
TTCTheo's Typesafe Cult
•Created by Ryan on 8/17/2023 in #questions
How to display register/signin errors on the client from a server action?
35 replies
TTCTheo's Typesafe Cult
•Created by Ryan on 8/11/2023 in #questions
'npx prisma db seed' not responding
13 replies
TTCTheo's Typesafe Cult
•Created by Ryan on 8/9/2023 in #questions
Next-Auth question about JWTs
This is my understanding of how JWT's and Session work in Next auth:
- I send a login form to the server
- the authorize(credentials) function finds a user associated with those credentials and returns user data.
- That user data and accompanying data is given to the JWT() callback
- The JWT() callback decides what to retain from this before the JWT is sent to my cookie jar
- The things that were given to the JWT() callback, as well as the things the JWT() callback chose to retain, are given to the session() callback
- The session() callback decides what to retain from the JWT and creates a session variable on the server.
- Next uses this session variable to decide what to render and and give back to me.
- Now I am logged in and want to request a page that requires specific authorization.
- I send a request, my JWT is decoded on the server and that decoded information is given to the Session. Next renders certain things to me based on the contents of that session variable.
My question is: If the validity of the session variable is a function of the validity of the JWT that my client has, why not just render things based on the JWT contents and not worry about passing it off to a middleman like session before rendering? Or is there functionally zero difference between these two realities
4 replies
TTCTheo's Typesafe Cult
•Created by Ryan on 8/9/2023 in #questions
Help understanding this line of JS/TS
9 replies