ReferenceError: Response is not defined
See original GitHub issueHi!
I’m experiencing a strange bug today. I was using your module successfully until this morning when suddenly all my test suites failed with error:
Test suite failed to run
ReferenceError: Response is not defined
at Object.<anonymous> (node_modules/jest-fetch-mock/src/index.js:11:24)
at Object.<anonymous> (__tests__/setupJest.js:1:103)
The only thing I did was removing my node-modules folder and then npm install them again. I imagine that I had some modules (or version of modules) in cache that disappeared with the rm command and were replaced by a new one after that. 🤔
But it doesn’t seems that any module associated with jest-fetch-mock has changed since yesterday.
I’ve attached a little project that should reproduce the bug. Just unzip it and run:
npm install
npm test
Thanks in advance for your help!
Issue Analytics
- State:
- Created 7 years ago
- Reactions:15
- Comments:10 (3 by maintainers)
Top Results From Across the Web
Why am I getting ReferenceError: Response is not defined?
I am trying to set up a basic server, but have no idea why I am getting a response error. var http =...
Read more >ReferenceError: Response is not defined #7007 - GitHub
Response is not a global in Node or JSDOM, so you have to polyfill it (by importing isomorphic-fetch or whatwg-fetch in a setup...
Read more >ReferenceError: response is not defined (Example) - Treehouse
ReferenceError : response is not defined. When go to the server I am getting the following error: Server running at http://<workspace-url>/ ...
Read more >Wanderlust - ReferenceError: response is not defined main.js ...
I'm having issues with step 13, when I try to check the browsers javascript console it keeps saying “ReferenceError: response is not defined...
Read more >Uncaught ReferenceError in Ajax get method - Laracasts
I'm tired this week bez of this one error.. here it show error like that........ create:209 Uncaught ReferenceError: response is not defined at...
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
ok, I’ve fixed my issue by adding
import 'isomorphic-fetch'at the beginning of mysetupJest.jsfile. But I still don’t understand how it was working previously without it…I’m doing it like this in my jest setup file now: