question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

initKeyboardEvent error

See original GitHub issue

With

import Gremlins from 'gremlins.js'
Gremlins.createHorde().unleash()

This error in console:

Uncaught TypeError: Failed to execute ‘initKeyboardEvent’ on ‘KeyboardEvent’: parameter 4 is not of type ‘Window’. gremlins.min.js?61fa:22

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:5
  • Comments:9 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
cdbusbycommented, Nov 20, 2016

@bcherny & @thepianist2 this fixed it for me as well. Would be good to have the bower/npm versions updated!

3reactions
thepianist2commented, Sep 2, 2016

I have been researching , and the version on the repository: https://github.com/marmelab/gremlins.js

It is different from that found in bower and npm .

Specifically this file :

https://github.com/marmelab/gremlins.js/blob/master/src/species/typer.js

It is not the same, in the version that failure bower and npm this line is the one that fails:

line 84 KeyboardEvent [ initMethod ] ( config.randomizer.pick ( config.eventTypes ) , true , true , targetElement , false, false , false, false , key , 0);

To fix it I imported the file repository :

https://github.com/marmelab/gremlins.js/blob/master/gremlins.min.js

and it is working properly but a error with socket-js.

this is really wrong? if so , when will update the version of npm and bower ?

Read more comments on GitHub >

github_iconTop Results From Across the Web

KeyboardEvent.initKeyboardEvent() - Web APIs | MDN
initKeyboardEvent () method initializes the attributes of a keyboard event ... method as experimental broke existing web apps (see bug 999645).
Read more >
initKeyboardEvent fires successfully but doesn't do anything.
What steps will reproduce the problem? 1.var event = document.createEvent('KeyboardEvent'); 2.event.initKeyboardEvent("keypress", true, true ...
Read more >
javascript - Basic example of initKeyboardEvent - Stack Overflow
I'm trying to find a basic example of the use of initKeyboardEvent() . Ideally, I want to create a keyboard event where when...
Read more >
ISSUE-157: Problems with initKeyboardEvent
2) There are a couple of problems with initKeyboardEvent(). First, when it first apperas in the gray box, it has a repeat argument....
Read more >
KeyboardEvent.initKeyboardEvent()
initKeyboardEvent () method initializes the attributes of a keyboard event ... method as experimental broke existing web apps (see bug 999645).
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found