redfin / react-server

:rocket: Blazing fast page load and seamless navigation.
https://react-server.io/
Apache License 2.0
3.89k stars 184 forks source link

react-server-redux breaks production compile #912

Closed mocheng closed 7 years ago

mocheng commented 7 years ago

With importing of react-server-redux, command NODE_ENV=production react-server compile" fails.

The importing of ReduxAdapter is simple as below.

import {ReduxAdapter} from 'react-server-redux';

The command NODE_ENV=production react-server compile" fails with below message.

There were errors in the JavaScript compilation. Home.ab7d7e279a3596bd49b0.bundle.js from UglifyJs SyntaxError: Unexpected token: name (ReduxAdapter) [./~/react-server-redux/ReduxAdapter.js:1,0] 2017-03-27T06:09:24.996Z - error: [react-server-cli.src.commands.compile] message=There were errors in the JavaScript compilation., stack=Error: There were errors in the JavaScript compilation. at handleCompilationErrors (/Users/morgan.cheng/github/react-server-demo/node_modules/react-server-cli/target/handleCompilationErrors.js:25:10)

The UglifyJS reports SyntaxError: Unexpected token: name (ReduxAdapter), even though npm start works fine.

I have a minimalist app to repo this problem: https://github.com/mocheng/react-server-demo

mocheng commented 7 years ago

This issue might related to the fact that react-server-redux is not transpiled in publishing.