Cannot read property 'removeListener' of undefined
See original GitHub issueSince we updated to version 3.3.0 we are getting the following error when we run npm test
:
TypeError: Cannot read property 'removeListener' of undefined
at PuppeteerEnvironment.teardown
(node_modules/jest-environment puppeteer/lib/PuppeteerEnvironment.js:109:22)
at Generator.throw (<anonymous>)
Our jest.config.js
looks like this:
module.exports = {
testMatch: [
// our test file regex
],
preset: 'jest-puppeteer'
};
Weirdly enough, we found a very temporary workaround:
- remove
"preset": "jest-puppeteer"
from the config and run the tests -> they fail - put it back in, re-run the tests -> they pass
- But: run the tests again -> they fail
The current versions we are using are:
"jest": "^23.5.0",
"jest-puppeteer": "^3.3.0",
"puppeteer": "^1.7.0"
It did work with the following versions:
"jest": "^23.3.0",
"jest-puppeteer": "^3.2.1",
"puppeteer": "^1.6.2"
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
How to get over Cannot read property 'removeEventListener ...
Cannot read property ' removeEventListener ' of null, is what I get. I read the React 17 docs regarding this, under "potential issues....
Read more >Cannot read property 'removeEventListener' of undefined
Cannot read property 'removeEventListener' of undefined. Question. Hello. I am working on an enterprise environment and I am building a mobile app.
Read more >Cannot read property 'removeListener' of undefined · Issue #192
Upon running my tests, I get the error ○ Test suite failed to run TypeError: Cannot read property 'removeListener' of undefined ...
Read more >Cannot read property 'removeEventListener' of undefined at M
Hi, I have a problem with FileUploadModule, I got this error when open upload-test page. Cannot read property 'removeEventListener' of undefined at ...
Read more >Next js TypeError: Cannot read properties of null (reading ...
... in my next js app, after joint to the meeting I have an error TypeError: Cannot read properties of null (reading 'removeEventListener')....
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 FreeTop 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
Top GitHub Comments
Version 3.3.1 works like a charm. I just hadn’t checked for updates when I created the issue this morning… Sorry!
Thanks for the reply.
I changed my puppeteer version to 1.11.0 and it started working with 3.7.0. Importance of fixing the version in the package.json file!