Comments (2)
A more minimal repro with a better error message
https://github.com/unlocomqx/cloudflare-svelte-bug
✘ [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: WritableStreamSink)
at EventEmitter.write
(file:///Users/USER/code/tests/cloudflare/my-svelte-app/node_modules/.pnpm/[email protected]/node_modules/postgres/cf/polyfills.js:182:16)
at nextWrite
(file:///Users/USER/code/tests/cloudflare/my-svelte-app/node_modules/.pnpm/[email protected]/node_modules/postgres/cf/src/connection.js:252:22)
at null.<anonymous>
(file:///Users/USER/code/tests/cloudflare/my-svelte-app/node_modules/.pnpm/[email protected]/node_modules/postgres/cf/polyfills.js:224:7)
at new Query
(file:///Users/USER/code/tests/cloudflare/my-svelte-app/node_modules/.pnpm/[email protected]/node_modules/postgres/cf/src/query.js:35:9)
at sql2
(file:///Users/USER/code/tests/cloudflare/my-svelte-app/node_modules/.pnpm/[email protected]/node_modules/postgres/cf/src/index.js:113:11)
at load
(file:///Users/USER/code/tests/cloudflare/my-svelte-app/.svelte-kit/output/server/entries/pages/_page.server.js:7:23)
at load_server_data
(file:///Users/USER/code/tests/cloudflare/my-svelte-app/.svelte-kit/output/server/index.js:1008:42)
at null.<anonymous>
(file:///Users/USER/code/tests/cloudflare/my-svelte-app/.svelte-kit/output/server/index.js:2538:24)
{
query: 'SELECT * FROM users',
parameters: [],
args: [],
types: []
}
from postgres.
I found the solution ✅
pocketbase/pocketbase#2185 (comment)
I have to recreate the db client with each new request!
from postgres.
Related Issues (20)
- Connection pool sometimes does not end properly HOT 3
- Incorrect type definitions causing confusion when trying to catch PostgresError HOT 1
- PostgresError: syntax error at or near "$1" HOT 1
- PostgresJS Prevents Natural Process Exit
- Mass Update JSONB Error
- TimeZone on connection
- Problem with inserting big numbers (more than 64bit) HOT 1
- Cannot use value interpolation within a COPY query HOT 2
- TypeError setting up client HOT 1
- Query Hooks HOT 1
- Feature request: dynamic username support for credential rotation HOT 1
- BUG: Interpolation issue while query building HOT 3
- Cloudflare: I/O Error HOT 1
- feat: support 'using' syntax and [Symbol.dispose]
- Getting Inserted id HOT 2
- Transforming undefined to `DEFAULT` HOT 1
- BUG: inconsistent behaviour inserting multiple records with implicit column names and some properties undefined.
- [BUG] Escape character in url string
- Strings with apostrophe are not properly escaped
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from postgres.