this._document.origin is undefined
See original GitHub issue🐛 Bug Report
When trying to use shallow on a component, I get TypeError: Cannot read property 'origin' of undefined at Window.get localStorage
. I have ComponentWillMount that is calling to a service that saves to local storage. The trace prints out an issue with JSDOM.
node_modules/jsdom/lib/jsdom/browser/Window.js:256:26
To Reproduce
const wrapper = shallow(<MyComponent />
System:
OS: macOS 10.14
CPU: x64 Intel(R) Core(TM) i7-7820HQ CPU @ 2.90GHz
Binaries:
Node: 10.3.0 - /usr/local/bin/node
Yarn: 1.7.0 - /usr/local/bin/yarn
npm: 6.1.0 - /usr/local/bin/npm
npmPackages:
jest: 23.6.0 => 23.6.0
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:13
Top Results From Across the Web
document.origin is undefined and cors policy violation
I made an api that is located at path localhost:3000 and localhost:3000/api/users returns users in json format.
Read more >document.origin is deprecated #539 - gnab/remark - GitHub
Chrome is reporting the following warning in the console: document.origin is deprecated and will be removed in M70, around October 2018.
Read more >Document.origin - Web APIs - MDN Web Docs
The Document.origin read-only property returns the document's origin. In most cases, this property is equivalent to document.
Read more >Solve the Cross-Origin Access error when working with iframes
This post will breifly explain the Cross-Origin access problem that is faced when accesing an iframe document and how you can setup your ......
Read more >JavaScript undefined Property - W3Schools
Well organized and easy to understand Web building tutorials with lots of examples of how to use HTML, CSS, JavaScript, SQL, Python, PHP,...
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
Hi there. I’m getting these too…
Kind of randomly… After removed
node_modules
and reinstalling again it stopped for a while, then again.My project uses localForage (for IndexedDB) and localStorage but this error comes up in unrelated files. I mean: the tests that fail and show this message are not related to localStorage at all.
I’d guess its a JSDOM error but since googling brought me straight here and it’s the same error just wanted to add as a +1
@thezachcannon i am facing the same issue…How were you able to fix this?