Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Another accept task is ongoing #6301

Closed
Jax-p opened this issue Jun 15, 2020 · 3 comments
Closed

Another accept task is ongoing #6301

Jax-p opened this issue Jun 15, 2020 · 3 comments
Labels
bug Something isn't working correctly cli related to cli/ dir

Comments

@Jax-p
Copy link

Jax-p commented Jun 15, 2020

I've just started with Deno v1.1.
I've tried to create my first class and whenever I try to instance it I get:
Uncaught Error: Another accept task is ongoing at unwrapResponse ($deno$/ops/dispatch_json.ts:43:11)
It happens only if I use MySQL client before but It works if I run any MySQL query before new MyClass.

MyClass.ts

class MyClass {
   // empty
}
export default MyClass;

server.ts

import { Application } from "https://deno.land/x/[email protected]/mod.ts"
import { Client } from "https://deno.land/x/mysql/mod.ts";
import { APP_HOST, APP_PORT } from "./config.ts";
import router from './routes.ts'
import MyClass from "./controllers/myclass.ts";

const app = new Application()

app.use(router.routes())
app.use(router.allowedMethods())

const db = await new Client().connect({
    //...
});

const myClass = new MyClass();
await app.listen(`${APP_HOST}:${APP_PORT}`);

I use theese flags:

deno run --allow-env --allow-net server.ts

Env

Linux Mint 19,
Deno 1.1

@ry
Copy link
Member

ry commented Jun 15, 2020

Thanks for the report. It would be very useful if you can narrow this down to a small example that uses only the Deno API.

@ry ry added bug Something isn't working correctly cli related to cli/ dir labels Jun 15, 2020
@Jax-p
Copy link
Author

Jax-p commented Jun 18, 2020

I've been trying to clarify this situation but I am not sure about it at all. As I've tested it can be corrected by banal adjustments that are not related to each other. It works if I do at least one of these:

  • remove ${APP_HOST}:${APP_PORT} from last console.log()
  • call any MySQL query before new MyClass()
  • don't instance any class
  • remove any method (which is not even used) from products.ts

I can't provide minimal reproducible code because I am really not sure whats going on.
So if you are interested I've created repository (Jax-p/denoTest) with whole code used and sent invitation to you.

In my another Deno projects everything works fine so I am not really in need of getting this working but it might bring some useful information for you. Btw. It was my first test and it doesn't work at all. I've just provided everything needed for the error.

Whole log:

error: Uncaught Error: Another accept task is ongoing
    at unwrapResponse ($deno$/ops/dispatch_json.ts:43:11)
    at Object.sendAsync ($deno$/ops/dispatch_json.ts:98:10)
    at async ListenerImpl.accept ($deno$/net.ts:63:17)
    at async Server.acceptConnAndIterateHttpRequests (https://deno.land/[email protected]/http/server.ts:216:14)
    at async MuxAsyncIterator.callIteratorNext (https://deno.land/[email protected]/async/mux_async_iterator.ts:28:29)

@ry
Copy link
Member

ry commented Jul 4, 2020

Let's move the discussion to #6616 - there is a better description of what's happening.

@ry ry closed this as completed Jul 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working correctly cli related to cli/ dir
Projects
None yet
Development

No branches or pull requests

2 participants