You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
As far as I can see, all the reference(s) to window are there to check that the environment has a global reference for the geolocator API.
In node.js backends, there supposedly is no support for the API at this point (2022-01-22), so checking that this code is only executed on browser(s) with support for the API seems like a proper precaution.
If I've misunderstood the issue, please elaborate.
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.
It seems you guys need to update /node_modules/geolocator/dist/geolocator.js with below check for window object.
The text was updated successfully, but these errors were encountered: