Weldawadyathink
Weldawadyathink
Explore posts from servers
TtRPC
Created by Weldawadyathink on 2/7/2025 in #❓-help
"Invalid Hook Call" with minimal example
For future readers, it seems like the issue was the react speedy web compiler. As soon as I switched to the default vite react plugin, it worked.
9 replies
TtRPC
Created by Weldawadyathink on 2/7/2025 in #❓-help
"Invalid Hook Call" with minimal example
I would love any ideas, even if it is just a shove in the right direction, or ideas that I might need to research.
9 replies
TtRPC
Created by Weldawadyathink on 2/7/2025 in #❓-help
"Invalid Hook Call" with minimal example
Should I assume nobody has any idea why this problem is happening?
9 replies
TtRPC
Created by Weldawadyathink on 2/7/2025 in #❓-help
"Invalid Hook Call" with minimal example
Based on all that info, I think: 1. I somehow got multiple versions of react in my codebase, but I have no idea how. Deno is using the node_modules directory, and I have confirmed only 1 copy of react, and tried multiple deletions of node_modules and reinstalls. 2. Somehow something I am doing is causing tRPC or react query to use hooks incorrectly and spark the Invalid Hook Call react error. I think this is extremely unlikely, since I doubt those programmers would use react incorrectly and I would be the only one with this issue. 3. I am doing something wrong with QueryClientProvider. I have no idea what I could be doing wrong since I follow the examples exactly. I appreciate any help or insight y'all might have.
9 replies
TtRPC
Created by Weldawadyathink on 2/7/2025 in #❓-help
"Invalid Hook Call" with minimal example
I get the same symptoms on tRPC v10 and v11.
9 replies
TtRPC
Created by Weldawadyathink on 2/7/2025 in #❓-help
"Invalid Hook Call" with minimal example
I also get a TypeError: null is not an object (evaluating 'dispatcher.useEffect'). I think this might be the real cause of my issues, but I don't use useEffect anywhere in the code yet (is it internal to trpc or react query?). I also get a defaultOnUncaughtError warning recommending adding an error boundary for QueryClientProvider.
9 replies
TtRPC
Created by Weldawadyathink on 2/7/2025 in #❓-help
"Invalid Hook Call" with minimal example
I get 2x react invalid hook call errors. I presume this is from the queryClient and trpcClient respectively. If I include the hooks and don't use the components in the JSX, I don't get those errors.
9 replies
TtRPC
Created by Weldawadyathink on 10/4/2024 in #❓-help
Error with AppRouter type mismatch in Deno
Update: I threw together a minimal replication using Bun. It still works, and all the type errors are gone. So I think this issue might stem from Deno. I am going to look into submitting this as a bug report to deno.
8 replies
TtRPC
Created by Weldawadyathink on 10/4/2024 in #❓-help
Error with AppRouter type mismatch in Deno
/server/routers/book.ts
import { router, publicProcedure } from "../trpc.ts";
import { z } from "zod";

export const bookRouter = router({
hello: publicProcedure.input(z.string().nullish()).query(({ input }) => {
return `Hello, ${input ?? "World"}!`;
}),
test: publicProcedure.query(() => "Hi there"),
});
import { router, publicProcedure } from "../trpc.ts";
import { z } from "zod";

export const bookRouter = router({
hello: publicProcedure.input(z.string().nullish()).query(({ input }) => {
return `Hello, ${input ?? "World"}!`;
}),
test: publicProcedure.query(() => "Hi there"),
});
8 replies
TtRPC
Created by Weldawadyathink on 10/4/2024 in #❓-help
Error with AppRouter type mismatch in Deno
server/routers/_app.ts
import { router } from "../trpc.ts";

import { bookRouter } from "./book.ts";

export const appRouter = router({
book: bookRouter,
});

export type AppRouter = typeof appRouter;
import { router } from "../trpc.ts";

import { bookRouter } from "./book.ts";

export const appRouter = router({
book: bookRouter,
});

export type AppRouter = typeof appRouter;
8 replies
TtRPC
Created by Weldawadyathink on 10/4/2024 in #❓-help
Error with AppRouter type mismatch in Deno
server/main.ts
import { Hono } from "hono";
import { serveStatic } from "hono/deno";
import { trpcServer } from "@hono/trpc-server";
import { appRouter } from "./routers/_app.ts";
import { cors } from "hono/cors";

const app = new Hono();

app.use(cors());

app.use(
"/trpc/*",
trpcServer({
endpoint: "/trpc",
router: appRouter,
}),
);

app.use(
"*",
serveStatic({
root: "./dist/",
}),
);

export default app;
import { Hono } from "hono";
import { serveStatic } from "hono/deno";
import { trpcServer } from "@hono/trpc-server";
import { appRouter } from "./routers/_app.ts";
import { cors } from "hono/cors";

const app = new Hono();

app.use(cors());

app.use(
"/trpc/*",
trpcServer({
endpoint: "/trpc",
router: appRouter,
}),
);

app.use(
"*",
serveStatic({
root: "./dist/",
}),
);

export default app;
8 replies
TtRPC
Created by Weldawadyathink on 10/4/2024 in #❓-help
Error with AppRouter type mismatch in Deno
The server section has no type errors. It is setup according to the trpc v10 documentation.
8 replies
TtRPC
Created by Weldawadyathink on 10/4/2024 in #❓-help
Error with AppRouter type mismatch in Deno
Entire error message:
Deno: Type
CreateRouterInner<RootConfig<{ ctx: object; meta: object; errorShape: DefaultErrorShape; transformer: DefaultDataTransformer; }>, { book: CreateRouterInner<...>; }>
does not satisfy the constraint Router<AnyRouterDef<AnyRootConfig, any>>
The types returned by createCaller(...) are incompatible between these types.
Type 'DecoratedProcedureRecord<{ book: CreateRouterInner<RootConfig<{ ctx: object; meta: object; errorShape: DefaultErrorShape; transformer: DefaultDataTransformer; }>, { ...; }>; }> & { ...; }' is not assignable to type 'DecoratedProcedureRecord<any> & { query: inferHandlerFn<any>; mutation: inferHandlerFn<any>; subscription: inferHandlerFn<any>; }'.
Type
DecoratedProcedureRecord<{ book: CreateRouterInner<RootConfig<{ ctx: object; meta: object; errorShape: DefaultErrorShape; transformer: DefaultDataTransformer; }>, { ...; }>; }> & { ...; }
is not assignable to type DecoratedProcedureRecord<any>
Property query is incompatible with index signature.
Type inferHandlerFn<{}> is not assignable to type
DecoratedProcedureRecord<any> | DecorateProcedure<any>
Type inferHandlerFn<{}> is not assignable to type DecorateProcedure<any>
Types of parameters path and input are incompatible.
Type any is not assignable to type never
Deno: Type
CreateRouterInner<RootConfig<{ ctx: object; meta: object; errorShape: DefaultErrorShape; transformer: DefaultDataTransformer; }>, { book: CreateRouterInner<...>; }>
does not satisfy the constraint Router<AnyRouterDef<AnyRootConfig, any>>
The types returned by createCaller(...) are incompatible between these types.
Type 'DecoratedProcedureRecord<{ book: CreateRouterInner<RootConfig<{ ctx: object; meta: object; errorShape: DefaultErrorShape; transformer: DefaultDataTransformer; }>, { ...; }>; }> & { ...; }' is not assignable to type 'DecoratedProcedureRecord<any> & { query: inferHandlerFn<any>; mutation: inferHandlerFn<any>; subscription: inferHandlerFn<any>; }'.
Type
DecoratedProcedureRecord<{ book: CreateRouterInner<RootConfig<{ ctx: object; meta: object; errorShape: DefaultErrorShape; transformer: DefaultDataTransformer; }>, { ...; }>; }> & { ...; }
is not assignable to type DecoratedProcedureRecord<any>
Property query is incompatible with index signature.
Type inferHandlerFn<{}> is not assignable to type
DecoratedProcedureRecord<any> | DecorateProcedure<any>
Type inferHandlerFn<{}> is not assignable to type DecorateProcedure<any>
Types of parameters path and input are incompatible.
Type any is not assignable to type never
That doesn't have any formatting, so here is the bit that looks the most important to me:
Type inferHandlerFn<{}> is not assignable to type DecorateProcedure<any>
Types of parameters path and input are incompatible.
Type any is not assignable to type never
Type inferHandlerFn<{}> is not assignable to type DecorateProcedure<any>
Types of parameters path and input are incompatible.
Type any is not assignable to type never
8 replies
CDCloudflare Developers
Created by Weldawadyathink on 4/12/2024 in #pages-help
Wrangler deployment fails if functions folder exists
I ended up deleting wrangler.toml and deploying with the command line options, and that was successful. When I get back, I’ll test it out with the compatability_date set explicitly in the toml.
14 replies
CDCloudflare Developers
Created by Weldawadyathink on 4/12/2024 in #pages-help
Wrangler deployment fails if functions folder exists
Anyone have any idea on this? I don’t need workers paid to use functions on pages, right?
14 replies
CDCloudflare Developers
Created by Weldawadyathink on 4/12/2024 in #pages-help
Wrangler deployment fails if functions folder exists
node 18.16.0
14 replies
CDCloudflare Developers
Created by Weldawadyathink on 4/12/2024 in #pages-help
Wrangler deployment fails if functions folder exists
wrangler 3.50.0 installed through pnpm
14 replies
CDCloudflare Developers
Created by Weldawadyathink on 4/12/2024 in #pages-help
Wrangler deployment fails if functions folder exists
Failed build with a hello world function: f5d832d8-6a23-4c87-b742-c1708b537d39 successful build with no function: 98ce902b-a03f-40bd-8f32-e8a3b396b67b
14 replies
CDCloudflare Developers
Created by Weldawadyathink on 4/12/2024 in #pages-help
Wrangler deployment fails if functions folder exists
Currently my functions folder is just a hello world onRequestGet to make sure there aren’t any JavaScript issues.
14 replies