Hi,
The source you've pushed to npm invokes window even though its not required and also not in the original source code. This prevents this library from being used in server-side rendered react projects like Gatsby.js
You might want to build the source with Webpack instead of babel directly.
ERROR #95312
"window" is not available during server side rendering.
See our docs page for more info on this error : https://gatsby.dev/debug-html
WebpackError: ReferenceError: window is not defined
geolocator.js:14 Object../node_modules/geolocator/dist/geolocator.js
node_modules/geolocator/dist/geolocator.js:14:2
It seems you guys need to update /node_modules/geolocator/dist/geolocator.js with below check for window object.
if(typeof window !== 'undefined') {
// the entire file contents.
}
Hi,
The source you've pushed to npm invokes window even though its not required and also not in the original source code. This prevents this library from being used in server-side rendered react projects like
Gatsby.jsYou might want to build the source with Webpack instead of babel directly.
It seems you guys need to update /node_modules/geolocator/dist/geolocator.js with below check for window object.