facebookarchive / react-page

Easy Application Development with React JavaScript
Apache License 2.0
797 stars 72 forks source link

ReferenceError: document is not defined #28

Closed necrodome closed 11 years ago

necrodome commented 11 years ago

With the current state of the app, I am getting the following error after starting the server with node server.js and requesting a page at http://localhost:8080/:

Error: ERROR RENDERING PAGE ON SERVER:
<mapped error>
ReferenceError: document is not defined
    at /Users/ypinar/Tmp/react-page/node_modules/react-tools/src/core/ReactDOMSelection.js:152:8
    at require (/Users/ypinar/Tmp/react-page/node_modules/react-page-middleware/polyfill/require.js:232:25)
    at /Users/ypinar/Tmp/react-page/node_modules/react-tools/src/core/ReactInputSelection.js:21:25
    at require (/Users/ypinar/Tmp/react-page/node_modules/react-page-middleware/polyfill/require.js:232:25)
    at /Users/ypinar/Tmp/react-page/node_modules/react-tools/src/core/ReactReconcileTransaction.js:25:27
    at require (/Users/ypinar/Tmp/react-page/node_modules/react-page-middleware/polyfill/require.js:232:25)
    at /Users/ypinar/Tmp/react-page/node_modules/react-tools/src/core/ReactComponentBrowserEnvironment.js:26:33
    at require (/Users/ypinar/Tmp/react-page/node_modules/react-page-middleware/polyfill/require.js:232:25)
    at /Users/ypinar/Tmp/react-page/node_modules/react-tools/src/core/ReactComponentEnvironment.js:20:3
    at require (/Users/ypinar/Tmp/react-page/node_modules/react-page-middleware/polyfill/require.js:232:25)
</mapped error>

    at renderReactPage (/Users/ypinar/Tmp/react-page/node_modules/react-page-middleware/src/renderReactPage.js:99:18)
    at renderedBundledText (/Users/ypinar/Tmp/react-page/node_modules/react-page-middleware/src/index.js:171:5)
    at /Users/ypinar/Tmp/react-page/node_modules/react-page-middleware/src/guard.js:29:10
    at Packager.computePackageForAbsolutePath.merge.onComputePackageDone (/Users/ypinar/Tmp/react-page/node_modules/react-page-middleware/src/index.js:146:7)
    at Object.onComputePackageDone (/Users/ypinar/Tmp/react-page/node_modules/react-page-middleware/src/guard.js:29:10)
    at onWarmed (/Users/ypinar/Tmp/react-page/node_modules/react-page-middleware/src/Packager.js:268:17)
    at /Users/ypinar/Tmp/react-page/node_modules/react-page-middleware/node_modules/async/lib/async.js:116:25
    at /Users/ypinar/Tmp/react-page/node_modules/react-page-middleware/node_modules/async/lib/async.js:24:16
    at /Users/ypinar/Tmp/react-page/node_modules/react-page-middleware/src/Packager.js:235:7
    at fs.js:266:14
jordwalke commented 11 years ago

@necrodome: Please reclone this repo. We should also tag versions of react-page with stable checkpoints, and in those checkpoints, refer to hashes of React that are known to be stable - but by default I like the "git clone the bleeding edge everything" by default because kind citizens such as @necrodome help find issues like this in the React core. :)