-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Description
Provide environment information
System:
OS: Windows 10 10.0.19044
CPU: (12) x64 Intel(R) Core(TM) i7-10750H CPU @ 2.60GHz
Memory: 458.92 MB / 15.75 GB
Binaries:
Node: 16.13.1 - C:\Program Files\nodejs\node.EXE
Yarn: 1.22.17 - ~\node_modules.bin\yarn.CMD
npm: 8.19.1 - C:\Program Files\nodejs\npm.CMD
Browsers:
Chrome: 109.0.5414.120
Edge: Spartan (44.19041.1266.0), Chromium (108.0.1462.76)
Internet Explorer: 11.0.19041.1566
npmPackages:
@tanstack/react-query: ^4.20.0 => 4.24.4
@trpc/client: ^10.9.0 => 10.10.0
@trpc/next: ^10.9.0 => 10.10.0
@trpc/react-query: ^10.9.0 => 10.10.0
@trpc/server: ^10.9.0 => 10.10.0
next: 13.1.6 => 13.1.6
react: 18.2.0 => 18.2.0
typescript: ^4.9.4 => 4.9.5
Describe the bug
Creating a T3 Project and attempted to also create a Vanilla client for monorepo needs.
Attempted to allow for cookie cors by following docs (and pasting in the code block to my code) at: https://trpc.io/docs/cors
Get following TS error
Argument of type '{ credentials: "include"; } | { credentials: "include"; body?: BodyInit | null | undefined; cache?: RequestCache | undefined; headers?: HeadersInit | undefined; ... 9 more ...; next?: NextFetchRequestConfig | undefined; } | { ...; }' is not assignable to parameter of type 'RequestInit | undefined'. Type '{ credentials: "include"; body?: string | ReadableStream<any> | null | undefined; headers?: [string, string][] | Record<string, string> | undefined; method?: string | undefined; signal?: AbortSignalEsque | ... 1 more ... | undefined; }' is not assignable to type 'RequestInit'. Types of property 'signal' are incompatible. Type 'AbortSignalEsque | null | undefined' is not assignable to type 'AbortSignal | null | undefined'. Type 'AbortSignalEsque' is missing the following properties from type 'AbortSignal': onabort, reason, throwIfAborted, removeEventListener, dispatchEventts(2345)
Link to reproduction
https://stackblitz.com/edit/github-4qbmy1?file=src/utils/trpc.ts
To reproduce
Use https://stackblitz.com/github/trpc/examples-next-minimal-starter
Go to https://trpc.io/docs/cors and copy entire const client
Go to utils/trpc.ts on the stackblitz
past in the const client
Update imports at top to look like:
import { createTRPCProxyClient, httpBatchLink } from '@trpc/client';
See TS error in the trpc proxy client.
Additional information
I don't seem to get the ts error when using trpc 10.0.0-proxy-beta.15
Hopefully this is helpful and not me being too stupid
👨👧👦 Contributing
- 🙋♂️ Yes, I'd be down to file a PR fixing this bug!