Skip to content

Commit

Permalink
Revert Next.js server fetching URL checks that caused issues with Con…
Browse files Browse the repository at this point in the history
…vex Auth (#33184)

GitOrigin-RevId: 9e1738ce45f28b1acb71ecf04aa18144bcd7fcac
  • Loading branch information
thomasballinger authored and Convex, Inc. committed Jan 15, 2025
1 parent 9ae2de6 commit 6a1a7e7
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 16 deletions.
5 changes: 0 additions & 5 deletions npm-packages/convex/src/nextjs/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,11 +181,6 @@ export async function fetchAction<Action extends FunctionReference<"action">>(
}

function setupClient(options: NextjsOptions) {
if ("url" in options && options.url === undefined) {
throw new Error(
"`url` property passed to convex/nextjs function but is undefined. Is an environment variable not set? If this is intended remove 'url' from the preloadQuery options.",
);
}
const client = new ConvexHttpClient(
getConvexUrl(options.url, options.skipConvexDeploymentUrlCheck ?? false),
);
Expand Down
11 changes: 0 additions & 11 deletions npm-packages/convex/src/nextjs/nextjs.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,6 @@ describe("env setup", () => {
"Environment variable NEXT_PUBLIC_CONVEX_URL is not set.",
);
});
test("requires url override to be present", async () => {
await expect(
preloadQuery(
anyApi.myQuery.default,
{},
{ url: process.env.ENVAR_THAT_NEVER_EXISTS },
),
).rejects.toThrow(
"`url` property passed to convex/nextjs function but is undefined. Is an environment variable not set? If this is intended remove 'url' from the preloadQuery options.",
);
});
});

describe("preloadQuery and usePreloadedQuery", () => {
Expand Down

0 comments on commit 6a1a7e7

Please sign in to comment.