seb
seb
CDCloudflare Developers
Created by seb on 4/4/2025 in #pages-help
Cannot perform I/O on behalf of a different request
I'm trying to use the postgres library with neon.tech but I get this error:
Error: Cannot perform I/O on behalf of a different request. I/O objects (such as streams, request/response bodies, and others) created in the context of one request handler cannot be accessed from a different request's handler. This is a limitation of Cloudflare Workers which allows us to improve overall performance. (I/O type: Writable)
Error: Cannot perform I/O on behalf of a different request. I/O objects (such as streams, request/response bodies, and others) created in the context of one request handler cannot be accessed from a different request's handler. This is a limitation of Cloudflare Workers which allows us to improve overall performance. (I/O type: Writable)
import postgres from 'postgres';
import { DATABASE_URL } from '$env/static/private';

export const sql = postgres(DATABASE_URL);
import postgres from 'postgres';
import { DATABASE_URL } from '$env/static/private';

export const sql = postgres(DATABASE_URL);
3 replies
CDCloudflare Developers
Created by seb on 4/4/2025 in #pages-help
Uncaught Error: No such module "node:events".
I'm trying to deploy my SvelteKit app on Cloudflare using bun I'm using the crypto module (importing it with node:crypto) and this is my wrangler.json:
{
"compatibility_flags": [
"nodejs_compat"
],
"compatibility_date": "2024-09-23"
}
{
"compatibility_flags": [
"nodejs_compat"
],
"compatibility_date": "2024-09-23"
}
I don't think that cloudflare is reading the configuration file tho because after a success message i get this:
Error: Failed to publish your Function. Got error: Uncaught Error: No such module "node:events".
imported from "functionsWorker-0.7426580704521399.js"
Error: Failed to publish your Function. Got error: Uncaught Error: No such module "node:events".
imported from "functionsWorker-0.7426580704521399.js"
4 replies