Failed to execute 'dispatchEvent' on 'EventTarget': parameter 1 is not of type 'Event' in Page.select()
See original GitHub issue- Puppeteer version: 0.12.0
- Platform / OS version: Ubuntu 16.04.3
When I do:
page.select('[name="resource_id"]', '25');
I get an error:
TypeError: Failed to execute 'dispatchEvent' on 'EventTarget': parameter 1 is not of type 'Event'.
If I comment both dispatchEvent lines in select(), I get no error. Both fail.
The element exists and is a <select> and the selection works. Only the event dispatching does not work.
Issue Analytics
- State:
- Created 6 years ago
- Comments:10 (4 by maintainers)
Top Results From Across the Web
javascript - dispatchEvent Causes error failed to execute ...
failed to execute 'dispatchEvent' on 'EventTarget': parameter 1 is not of type 'Event'. I have tried everything, and found out that this will...
Read more >TypeError: parameter 1 is not of type 'Event'
TypeError: Failed to execute 'dispatchEvent' on 'EventTarget': parameter 1 is not of type 'Event'. This is the code I have, you would use ......
Read more >Failed to execute 'dispatchEvent' on 'EventTarget' - DataTables
I'm trying to implement export buttons at my Datatable, but when I try to click ... on 'EventTarget': parameter 1 is not of...
Read more >EventTarget.dispatchEvent() - Web APIs | MDN
The dispatchEvent() method of the EventTarget sends an Event to the object, (synchronously) invoking the affected EventListeners in the ...
Read more >Typeerror: Failed To Execute 'Dispatchevent' On 'Eventtarget'
Typeerror: Failed To Execute 'Dispatchevent' On 'Eventtarget': Parameter 1 Is Not Of Type 'Event' ... Create and dispatch events in a component's JavaScript...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Ooooooh, I might know what it is, but that’s unexpected (for me, for you it’s obvious). My very old JS lib overrides
window.Event, so it’s not a nativeEventanymore. This is unexpected for me, and obvious for you, because I didn’t know the stringified version of thethis.$evalcallback function is called inside the page’s context, not in Puppeteer/node context.That’s browser JS, not NodeJS… Ah.
I now see I can reproduce this exact error in Real Chrome:
So, yes, my JS is definitely too hacky. Sorry!
Hey guys, I have a a question regarding this:
I’m trying to attempt to get the direct link for a google drive video. To do that, I first navigate to the drive embed-video URL, then click on the play button (There are many of them), then wait for the iframe containing a video element to appear, then get the video element in the iframe, then I’m trying to get the source of the video, but it appears to be null, so I tried getting the outerHTML, and this is what I got in the console:
Seemingly it hasn’t been loaded yet, but I’m not sure what event to wait for, I waited for a timeout of 15 seconds but still got the same result, here’s my code:
Any ideas, am I doing something wron? why is the “src” attribute not showing up on the video element? [1]: https://github.com/GoogleChrome/puppeteer/blob/v1.13.0/docs/api.md#elementhandleselector-1