ulixee / hero

The web browser built for scraping
MIT License
649 stars 32 forks source link

(intermediate value).addEventListener is not a function #203

Closed soundofspace closed 1 year ago

soundofspace commented 1 year ago

I see this error happening a lot, don't really know why. In discord this was mention It kind of looks like a Hero instance getting shutdown mid-creation, which could definitely happen since there are timeouts on everything, and case something is not fast enough, the instance is closed, and so is hero. This might mean a hero is closed while the core is still doing something on it? This does not seem to crash the core and could probably be ignored, or even better should detect a close, and don't do this.

TypeError: (intermediate value).addEventListener is not a function
    at Tab.addEventListener (/app/service/.yarn/cache/@ulixee-hero-npm-2.0.0-alpha.16-dcd2a28d00-4cf8e995f3.zip/node_modules/client/lib/AwaitedEventTarget.ts:17:27)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
2022-12-07T13:11:28.173Z ERROR [hero-core/index] UnhandledRejection { context: {}, sessionId: null, sessionName: undefined } TypeError: (intermediate value).addEventListener is not a function
    at Tab.addEventListener (/app/service/.yarn/cache/@ulixee-hero-npm-2.0.0-alpha.16-dcd2a28d00-4cf8e995f3.zip/node_modules/client/lib/AwaitedEventTarget.ts:17:27)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
TypeError: (intermediate value).addEventListener is not a function
    at Tab.addEventListener (/app/service/.yarn/cache/@ulixee-hero-npm-2.0.0-alpha.16-dcd2a28d00-4cf8e995f3.zip/node_modules/client/lib/AwaitedEventTarget.ts:17:27)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
TypeError: (intermediate value).addEventListener is not a function
    at Tab.addEventListener (/app/service/.yarn/cache/@ulixee-hero-npm-2.0.0-alpha.16-dcd2a28d00-4cf8e995f3.zip/node_modules/client/lib/AwaitedEventTarget.ts:17:27)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
soundofspace commented 1 year ago

Probably similar to #204

blakebyrnes commented 1 year ago

Have a fix for this one in latest unblocked. Let's re-test with the next release.

soundofspace commented 1 year ago

Thanks will leave the issue open until then. Does this also fix #204, or is it something else?

blakebyrnes commented 1 year ago

No, I don't think they're related. #204 is in Core.

blakebyrnes commented 1 year ago

This is in version 2.0.0-alpha.17

blakebyrnes commented 1 year ago

@soundofspace Is this resolved?

soundofspace commented 1 year ago

@blakebyrnes yes it is, sorry forgot about this.