NlaakALD
NlaakALD
CCConvex Community
Created by NlaakALD on 12/11/2024 in #support-community
Are we sure this is working?
https://github.com/get-convex/template-nextjs-convexauth-shadcn I've cloned, gone through the config steps and provided Resend, Github. For magic-link, After clicking link in email it opens sign in page in separate tab and not logged it. For Github, it complains: Be careful! The redirect_uri is not associated with this application. The application might be misconfigured or could be trying to redirect you to a website you weren't expecting. I am of course running localhost. So I went through steps again. I am missing something or something missing from docs?
70 replies
CCConvex Community
Created by NlaakALD on 10/29/2024 in #support-community
Resend, Email verification/login not working?
No description
18 replies
CCConvex Community
Created by NlaakALD on 10/4/2024 in #support-community
Server show signed in & refreshed token, yet, <Unauthenticated> is triggered
No description
24 replies
CCConvex Community
Created by NlaakALD on 9/27/2024 in #support-community
Convex Log Error "auth:store Invalid Refresh Token"
No description
13 replies
CCConvex Community
Created by NlaakALD on 9/19/2024 in #support-community
Convex-Auth/NextJS/NPM (Not Vite)
No description
44 replies
CCConvex Community
Created by NlaakALD on 6/20/2024 in #support-community
Unable to push deployment config to ...
Hi all. I just started having this issue about 2 hours ago. The Live Site is working with no issues, but the dev side will not update config. Says OPEN_API_KEY not defined but it is and has been for last 20 days. I though I might have broke something after not being able to figure it out, so i stashed and pulled in the live version (production) and its doing the same thing. so i created a component to test OpenAI connection
"use client";

import { useAction } from "convex/react";
import { api } from "../convex/_generated/api";

const CheckOpenAI = () => {
const checkConnectionAction = useAction(api.openai.checkConnection);

const handleCheck = async () => {
const result = await checkConnectionAction();
console.log(result);
};

return <button onClick={handleCheck}>Check OpenAI Connection</button>;
}

export default CheckOpenAI;
"use client";

import { useAction } from "convex/react";
import { api } from "../convex/_generated/api";

const CheckOpenAI = () => {
const checkConnectionAction = useAction(api.openai.checkConnection);

const handleCheck = async () => {
const result = await checkConnectionAction();
console.log(result);
};

return <button onClick={handleCheck}>Check OpenAI Connection</button>;
}

export default CheckOpenAI;
and added a function to the openai.ts file in convex folder
const openai = new OpenAI({
apiKey: process.env.OPENAI_API_KEY,
})

export const checkConnection = action({
args: {},
handler: async () => {
try {
const openai = new OpenAI({
apiKey: process.env.OPENAI_API_KEY,
});

// Make a simple API call to list models
const response = await openai.models.list();

// If we get here without throwing an error, the connection is working
return { success: true, message: "Connection to OpenAI API is working" };
} catch (error) {
// If there's an error, the connection failed
return {
success: false,
message: "Failed to connect to OpenAI API",
error: error instanceof Error ? error.message : String(error)
};
}
},
});
const openai = new OpenAI({
apiKey: process.env.OPENAI_API_KEY,
})

export const checkConnection = action({
args: {},
handler: async () => {
try {
const openai = new OpenAI({
apiKey: process.env.OPENAI_API_KEY,
});

// Make a simple API call to list models
const response = await openai.models.list();

// If we get here without throwing an error, the connection is working
return { success: true, message: "Connection to OpenAI API is working" };
} catch (error) {
// If there's an error, the connection failed
return {
success: false,
message: "Failed to connect to OpenAI API",
error: error instanceof Error ? error.message : String(error)
};
}
},
});
All is good except thats its not. npx convex dev is spamming
Error: Unable to push deployment config to https://dapper-corgi-203.convex.cloud
Error fetching POST https://dapper-corgi-203.convex.cloud/api/push_config 400 Bad Request: InvalidModules: Hit an error while pushing:
Loading the pushed modules encountered the following
error:
Failed to analyze openai.js: Uncaught Error: The OPENAI_API_KEY environment variable is missing or empty; either provide it, or instantiate the OpenAI client with an apiKey option, like new OpenAI({ apiKey: 'My API Key' }).
at new OpenAI (../node_modules/openai/src/index.ts:120:188)
at <anonymous> (../convex/openai.ts:7:10)
Error: Unable to push deployment config to https://dapper-corgi-203.convex.cloud
Error fetching POST https://dapper-corgi-203.convex.cloud/api/push_config 400 Bad Request: InvalidModules: Hit an error while pushing:
Loading the pushed modules encountered the following
error:
Failed to analyze openai.js: Uncaught Error: The OPENAI_API_KEY environment variable is missing or empty; either provide it, or instantiate the OpenAI client with an apiKey option, like new OpenAI({ apiKey: 'My API Key' }).
at new OpenAI (../node_modules/openai/src/index.ts:120:188)
at <anonymous> (../convex/openai.ts:7:10)
and npm run dev is giving error
Error: [Request ID: 16acc18b4019ebfc] Server Error
Could not find public function for 'openai:checkConnection'. Did you forget to run `npx convex dev` or `npx convex deploy`?
Error: [Request ID: 16acc18b4019ebfc] Server Error
Could not find public function for 'openai:checkConnection'. Did you forget to run `npx convex dev` or `npx convex deploy`?
the last error is because i cannot update config (convex). The only thing that changed was i upgraded to pro from free. Am i missing something?
2 replies