-
Notifications
You must be signed in to change notification settings - Fork 883
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ReferenceError: window is not defined #69
Comments
Hi, Please refer to #45 for more information. |
This worked for me 2-I've replaced window object by global object then i resolve window ior document is not defined issues Hope it would resolve your issue |
Or use https://www.npmjs.com/package/@react-leaflet/universal-leaflet
|
It still shows an error. |
This could hlep: |
|
what is the /header.js file? |
If you are using the app router, make sure to change the docs to app router version. and make sure you put the leaflet map in a separate component and dynamically import it. |
Hi there,
When I include the react-leaflet library I seem to get "ReferenceError: window is not defined".
This comes from leaflet-src.js as far as I can see, any ideas? Seems like I'm including something incorrectly.
ReferenceError: window is not defined
at Object. (C:\Applications\Nexus\Nexus\node_modules\leaflet\dist
\leaflet-src.js:9163:3)
at Module._compile (module.js:460:26)
at Module._extensions..js (module.js:478:10)
at Object.require.extensions.(anonymous function) [as .js](C:Applications
NexusNexusnode_modulesbabelnode_modulesbabel-corelibapiregisternode.js:
214:7)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at Object. (C:\Applications\Nexus\Nexus\node_modules\react-leafle
t\lib\index.js:9:16)
at Module._compile (module.js:460:26)
14 Sep 11:44:46 - [nodemon] app crashed - waiting for file changes before starti
ng...
The text was updated successfully, but these errors were encountered: