-
Notifications
You must be signed in to change notification settings - Fork 207
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
A secretKey or apiKey must be provided error in Cloudflare Workers + Remix #1540
Comments
In your export const loader = async (args: LoaderArgs) => {
return rootAuthLoader(args, () => {
return {};
}, {
secretKey: args.context.CLERK_SECRET_KEY,
publishableKey: args.context.CLERK_PUBLISHABLE_KEY,
});
}; Although, I don't do this and it works fine for me. |
Thank you @Ehesp, @aerojeyenth - does this resolve your issue? |
Thanks @Ehesp It worked only after adding the following in the export const loader: LoaderFunction = async ({ request, context, params }) => {
const { userId } = await getAuth(
{ request, context, params },
{
secretKey: context.env)["CLERK_SECRET_KEY"]
}
);
if (!userId) {
return redirect("/sign-in");
}
return { result };
}; |
@jescalan With both the fixes(#1540 (comment) and #1540 (comment)) it works !!! |
Amazing! So glad this was worked out. Will close out - please let us know if there's anything else we can do to make your Clerk experience better 💖 |
I am facing the same problem while deploying my next app to a VPS and using git hub actions. And for some reason the secret key is not loaded and i have this error. |
@Steravy I'd recommend opening a new issue or reaching out to our support team with a minimal reproduction! |
Package + Version
@clerk/remix
version 2.9.0Dependencies + versions
Browser/OS
If applicable e.g.
Chrome latest
,Node 18 LTS
,Cloudflare worker wrangler 3.4.0
Description
I followed the official documentation and set up the project and ran it locally.
I set up the
ENV
valuesCLERK_PUBLISHABLE_KEY
andCLERK_SECRET_KEY
in line with the Cloudflare Wrangler documentation in.dev.vars
file in the root.Wrangler successfully set up the ENV values as per the following message:
But I get the following error message from @clerk A secretKey or apiKey must be provided error
Please kindly help me if I am missing something.
Thank you.
The text was updated successfully, but these errors were encountered: