Code Monkey home page Code Monkey logo

Comments (2)

unlocomqx avatar unlocomqx commented on July 19, 2024

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: []
  }

Deployed

from postgres.

unlocomqx avatar unlocomqx commented on July 19, 2024

I found the solution ✅

pocketbase/pocketbase#2185 (comment)

I have to recreate the db client with each new request!

from postgres.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.