Giter Club home page Giter Club logo

Comments (11)

reselbob avatar reselbob commented on July 18, 2024 3
error: Uncaught BadResource: Bad resource ID 
    at unwrapResponse ($deno$/ops/dispatch_minimal.ts:63:11)
    at Object.sendAsyncMinimal ($deno$/ops/dispatch_minimal.ts:106:10)
    at async Object.read ($deno$/ops/io.ts:39:17)
    at async BufReader._fill (https://deno.land/[email protected]/io/bufio.ts:85:18)
    at async BufReader.readByte (https://deno.land/[email protected]/io/bufio.ts:198:7)
    at async readLine (https://raw.githubusercontent.com/keroxp/deno-redis/master/io.ts:91:15)
    at async readArrayReply (https://raw.githubusercontent.com/keroxp/deno-redis/master/io.ts:141:16)
    at async RedisSubscriptionImpl.receive (https://raw.githubusercontent.com/keroxp/deno-redis/master/pubsub.ts:64:20)
    at async file:///Users/reselbob/Documents/source-tree/denodemo/pubbersubber/types/providers/redis.ts:70:46

from redis.

ebebbington avatar ebebbington commented on July 18, 2024 1

@keroxp I hope you don't mind me giving input...

@reselbob Can you provide the exact code you used? How you are running/using it? I assume the above is pseudo-code as well as it isn't valid code.

Usually I see Bad Resource ID when a subprocess using Deno.run isn't closed properly or passed invalid values

from redis.

reselbob avatar reselbob commented on July 18, 2024 1

Here is the code: https://github.com/reselbob/denodemo/blob/master/pubbersubber/types/providers/redis.ts

Here is the project it runs within: https://github.com/reselbob/denodemo/tree/master/pubbersubber

Here is the test: https://github.com/reselbob/denodemo/blob/master/pubbersubber/tests/connection_test.ts , starting at line 63:

You need to have rabbitmq and redis running. I've put this all in the test script found here:

https://github.com/reselbob/denodemo/blob/master/pubbersubber/tests/run_tests

Thanks for your attention. Any help will be appreciated a lot! If the error is due some bad programming on my part, which it very well might be, please forgive me.

from redis.

reselbob avatar reselbob commented on July 18, 2024 1

Sorry, the repo was private. Now it's not.

from redis.

uki00a avatar uki00a commented on July 18, 2024 1

@reselbob @ebebbington
Thanks for reporting this issue!
I was able to reproduce the same error.
I'll look into it.

from redis.

uki00a avatar uki00a commented on July 18, 2024 1

Steps to reproduce

I have a file named mod.ts:

import { connect } from "https://deno.land/x/[email protected]/redis.ts";

const redis = await connect({ hostname: "localhost" });
const sub = await redis.subscribe("test");

(async () => {
  for await (const { channel, message } of sub.receive()) {
    console.log("channel: " + channel);
    console.log("message: " + message);
  }
})();

redis.close();

When running the mod.ts, the following error occurs:

$ deno run --allow-net ./mod.ts
error: Uncaught BadResource: Bad resource ID 
    at unwrapResponse ($deno$/ops/dispatch_minimal.ts:63:11)
    at Object.sendAsyncMinimal ($deno$/ops/dispatch_minimal.ts:106:10)
    at async Object.read ($deno$/ops/io.ts:39:17)
    at async BufReader._fill (https://deno.land/[email protected]/io/bufio.ts:85:18)
    at async BufReader.readByte (https://deno.land/[email protected]/io/bufio.ts:198:7)
    at async readLine (https://deno.land/x/[email protected]/io.ts:91:15)
    at async readArrayReply (https://deno.land/x/[email protected]/io.ts:141:16)
    at async RedisSubscriptionImpl.receive (https://deno.land/x/[email protected]/pubsub.ts:64:20)
    at async file:///home/uki00a/projects/deno-redis/mod.ts:8:38

Environment

deno 1.1.0
v8 8.4.300
typescript 3.9.2

from redis.

ebebbington avatar ebebbington commented on July 18, 2024 1

@uki00a Shame I didn't have the time to help out more!

from redis.

reselbob avatar reselbob commented on July 18, 2024 1

I am happy I was able to help. Deno is important as is being able to use Redis with it! Thanks for your attention.

from redis.

ebebbington avatar ebebbington commented on July 18, 2024

@reselbob Doesn't seem like any of those links work?

from redis.

ebebbington avatar ebebbington commented on July 18, 2024

No problem! Do you have the error stack it displays too?

from redis.

uki00a avatar uki00a commented on July 18, 2024

@reselbob Hi! This problem has been fixed at v0.10.3. Please update to it.

@ebebbington Thanks for your help! It really helps us.

from redis.

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.