© 2026 Hedgehog Software, LLC
from origin 'null' has been blocked by CORS policy
trpc.post.hello.useQuery({ text: "world" });
// Figma UI const client = trpc.createClient({ httpBatchLink({ url: "http://localhost:3000/api/trpc", transformer: SuperJSON, headers: () => { const headers = new Headers(); headers.set("x-trpc-source", "figma-plugin-ui"); headers.set("Access-Control-Allow-Origin", "*"); return headers; }, }), ], }); // next app api/[trpc]/route.ts const createContext = async (req: NextRequest) => { req.headers.set("Access-Control-Allow-Origin", "*"); req.headers.set("Access-Control-Allow-Methods", "GET, POST, OPTIONS"); req.headers.set("Access-Control-Allow-Headers", "*"); return createTRPCContext({ headers: req.headers, }); };
mode
no-cors
OPTIONS
const client = trpc.createClient({ // ... fetch: (url, options) => { return fetch(url, { ...options, mode: "no-cors", }); } })
TRPCClientError: Unexpected end of input