easybase-react
easybase-react copied to clipboard
Window undefined error
I am using the razzlejs framework and I started getting a "window undefined" error in the cache.ts file. I was able to get rid of it by changing the following, beginning on line 3 of /src/cache.ts:
I changed this:
const storage = new Storage({ storageBackend: window.localStorage });
To this:
const storage = () => {
if(typeof window !== undefined){
return new Storage({storageBackend: window.localStorage});
}
}
It's been working perfectly with testing after this change, so I thought I'd pass it along. Thanks!
Thank you @jolivr. It's great to have a fix for the razzlejs framework.
I'll add that change for the next release. Thanks!