yinks
yinks
Explore posts from servers
CDCloudflare Developers
Created by yinks on 8/19/2024 in #workers-help
No loader is configured for ".node" files
My worker uses email-reply-parser https://github.com/crisp-oss/email-reply-parser which internally uses re2 and it's causing a deployment error because re2 imports a .node file
3 replies
TtRPC
Created by yinks on 7/28/2024 in #❓-help
Suddenly started getting a `TRPCClientError: Unexpected token '<', "<!DOCTYPE...` error
And my whole app can't run, I've been at it for the whole day. Using React Vite with the React Query integration
5 replies
CDCloudflare Developers
Created by yinks on 7/25/2024 in #workers-help
Is there a way to specify the wrangler file directory?
I'm trying to deploy a static react app to cloudflare pages in a monorepo, everything works but it can't find the wrangler file because it's in a child directory, not the monorepo root.
11 replies
DTDrizzle Team
Created by yinks on 7/17/2024 in #help
Does Drizzle ORM HTTP proxy Driver work for D1 Http Rest API
Does Drizzle ORM HTTP proxy Driver work for D1 Http Rest API
2 replies
DTDrizzle Team
Created by yinks on 7/17/2024 in #help
Is it possible to use drizzle with d1 on http
Unfortunately, it's not possible to access cloudflare bindings in non worker envinroment. But I have some task functions that need to access the db but not from the worker.
3 replies
CDCloudflare Developers
Created by yinks on 9/13/2023 in #workers-help
Correct way to set CORS in Cloudflare Workers
I've been trying to set CORS headers following the docs but it doesn't seem to be working for me.
import { appRouter, createTRPCContext } from 'trpc';
import { fetchRequestHandler } from '@trpc/server/adapters/fetch';

export default {
async fetch(request: Request): Promise<Response> {
console.log('requestHeaders:', JSON.stringify([...request.headers], null, 2));

const response = await fetchRequestHandler({
req: request,
endpoint: '/trpc',
router: appRouter,
createContext: createTRPCContext,
onError({ error, path }) {
console.error(`>>>>>> tRPC Error on '${path}'`, error);
},
});

const corsResponse = new Response(response.body, response);

corsResponse.headers.set('Access-Control-Allow-Origin', '*');
corsResponse.headers.set('Access-Control-Allow-Methods', 'GET, POST, OPTIONS');
corsResponse.headers.set('Access-Control-Allow-Headers', '*');

return corsResponse;
},
};
import { appRouter, createTRPCContext } from 'trpc';
import { fetchRequestHandler } from '@trpc/server/adapters/fetch';

export default {
async fetch(request: Request): Promise<Response> {
console.log('requestHeaders:', JSON.stringify([...request.headers], null, 2));

const response = await fetchRequestHandler({
req: request,
endpoint: '/trpc',
router: appRouter,
createContext: createTRPCContext,
onError({ error, path }) {
console.error(`>>>>>> tRPC Error on '${path}'`, error);
},
});

const corsResponse = new Response(response.body, response);

corsResponse.headers.set('Access-Control-Allow-Origin', '*');
corsResponse.headers.set('Access-Control-Allow-Methods', 'GET, POST, OPTIONS');
corsResponse.headers.set('Access-Control-Allow-Headers', '*');

return corsResponse;
},
};
Error: Access to fetch at 'http://127.0.0.1:8787/trpc/example.hello?batch=1&input=%7B%220%22%3A%7B%22json%22%3A%7B%22text%22%3A%22Yinka%22%7D%7D%7D' from origin 'http://localhost:3000' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: It does not have HTTP ok status.
3 replies
TtRPC
Created by yinks on 8/28/2023 in #❓-help
I'm curious to know if anyone has any suggestions on how I can track the replies to the emails
I'm curious to know if anyone has any suggestions on how I can track the replies to the emails I send programmatically. Basically, I want to know if there's a way to keep track of when someone replies to an email I've sent through my program
2 replies