Change:
<!-- Note: if the issue is about documentation or the website, please file it at: --Do you want to request a feature or report a bug? Reporting a Bug What is the current behavior? The main issue is an exception that get's thrown when I try to call ReactDOMServer.renderToStaticMarkup() when NODEENV is set to production as long as I change the NODEENV to anything other than production things work fine but in PROD this happens: You can use the repo provided to reproduce the error. The issue seems to stem from ReactDebugCurrentFrame is not defined in production and yet ReactDOMServer tries to access it when NODEENV is prod and the error happens right now I have to break my ReactDOMServer renders out into it's own script and run it when NODEENV is not prod The triggering lines from are here: You can see the same issue again here (in Chinese) this seems to be new in React 16 If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem. Your bug will get fixed much faster if we can run your code and it doesn't have dependencies other than React. Paste the link to your JSFiddle () or CodeSandbox () example below: What is the expected behavior? I would expect to be able to call ReactDOMServer.renderToStaticMarkup with NODE_ENV = production and have it work to turn react classes into a HTML string document. Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React? I think this is new in React16.
This looks like you’re using production version of the package with a development version of the package. That’s not supported. I haven’t looked at your repo yet but I hope this helps!
Thank you. You were right. I compiled staticWriter with a dev version of and then called it with NODEENV=production. I've fixed it so that I now compile with the right NODEENV for each environment. You da' bes!

Discussion:
### Polyfills Needed to Support Older Browsers <ins> These six functions can be polyfilled using `es5-shim.js` from [kriskowal's es5-shim](https://github.com/kriskowal/es5-shim): </ins> * `Array.isArray` * `Array.prototype.forEach` * `Array.prototype.indexOf` <del> * `Function.prototype.bind` </del> <ins> * `Array.prototype.some` </ins> * `Date.now` <del> * `Array.prototype.some` (also in `es5-shim.js`) </del> <ins> * `Function.prototype.bind` </ins> <del> All of these can be polyfilled using `es5-shim.js` from [https://github.com/kriskowal/es5-shim](https://github.com/kriskowal/es5-shim). </del> <ins> Other required polyfills: </ins> <del> * `console.*` - Only needed when not using the minified build. If you need to polyfill this, try [https://github.com/paulmillr/console-polyfill](https://github.com/paulmillr/console-polyfill). * `Object.create` - Provided in `es5-sham.js` @ [https://github.com/kriskowal/es5-shim](https://github.com/kriskowal/es5-shim). </del> <ins> * `Object.create` – Provided by `es5-sham.js` from [kriskowal's es5-shim](https://github.com/kriskowal/es5-shim). * `console.*` – Only needed when using the unminified build. If you need to polyfill this, try [paulmillr's console-polyfill](https://github.com/paulmillr/console-polyfill). </ins>