erikras / erikras/react-redux-universal-hot-example

Disabling server side rendering doesn't work

Open
#507 6 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
12.1k
Forks
2.5k
PR merge metrics
No merged PRs in 30d

Description

I was trying to use https://github.com/PaulLeCam/react-leaflet with react-redux-universal-hot-example. Leaflet does its DOM manipulation outside React so obviously it won't work with server side rendering. I tried to disable server side render in `bin/server.js`

```
global.__DISABLE_SSR__ = true; // <----- DISABLES SERVER SIDE RENDERING FOR ERROR DEBUGGING
```

But it didn't have any effect.

```
[1] [piping] can't execute file: /Users/jsyrjala/projects/react/map/bin/server.js
[1] [piping] error given was: ReferenceError: window is not defined
[1] at Object. (/Users/jsyrjala/projects/react/map/node_modules/leaflet/dist/leaflet-src.js:9168:3)
[1] at Module._compile (module.js:460:26)
[1] at Module._extensions..js (module.js:478:10)
[1] at require.extensions.(anonymous function) (/Users/jsyrjala/projects/react/map/node_modules/babel-core/lib/api/register/node.js:214:7)
[1] at /Users/jsyrjala/projects/react/map/node_modules/webpack-isomorphic-tools/node_modules/require-hacker/babel-transpiled-modules/require hacker.js:260:64
[1] at webpack_isomorphic_tools.require (/Users/jsyrjala/projects/react/map/node_modules/webpack-isomorphic-tools/babel-transpiled-modules/index.js:280:11)
[1] at /Users/jsyrjala/projects/react/map/node_modules/webpack-isomorphic-tools/babel-transpiled-modules/index.js:237:18
[1] at Object._module3.default._extensions.(anonymous function) [as .js] (/Users/jsyrjala/projects/react/map/node_modules/webpack-isomorphic-tools/node_modules/require-hacker/babel-transpiled-modules/require hacker.js:247:17)
[1] at Module.load (module.js:355:32)
[1] at Module._load (module.js:310:12)
[1] [piping] further repeats of this error will be suppressed...
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.