jpsierens / webpack-react-redux

A boilerplate for playing around with react, redux and react-router with the help of webpack.
MIT License
599 stars 196 forks source link

Build Failed for the following error #7

Closed ZihangYin closed 7 years ago

ZihangYin commented 8 years ago

ERROR in ./app/index.js Module build failed: ReferenceError: Symbol is not defined at plugin (/Users/yinz/Downloads/webpack-react-redux-react-router-master/node_modules/react-hot-loader/lib/babel/index.js:86:23) at Function.memoisePluginContainer (/Users/yinz/Downloads/webpack-react-redux-react-router-master/node_modules/babel-core/lib/transformation/file/options/option-manager.js:109:13) at Function.normalisePlugin (/Users/yinz/Downloads/webpack-react-redux-react-router-master/node_modules/babel-core/lib/transformation/file/options/option-manager.js:142:32) at /Users/yinz/Downloads/webpack-react-redux-react-router-master/node_modules/babel-core/lib/transformation/file/options/option-manager.js:180:30 at Array.map (native) at Function.normalisePlugins (/Users/yinz/Downloads/webpack-react-redux-react-router-master/node_modules/babel-core/lib/transformation/file/options/option-manager.js:154:20) at OptionManager.mergeOptions (/Users/yinz/Downloads/webpack-react-redux-react-router-master/node_modules/babel-core/lib/transformation/file/options/option-manager.js:228:36) at OptionManager.init (/Users/yinz/Downloads/webpack-react-redux-react-router-master/node_modules/babel-core/lib/transformation/file/options/option-manager.js:373:12) at File.initOptions (/Users/yinz/Downloads/webpack-react-redux-react-router-master/node_modules/babel-core/lib/transformation/file/index.js:221:65) at new File (/Users/yinz/Downloads/webpack-react-redux-react-router-master/node_modules/babel-core/lib/transformation/file/index.js:141:24) at Pipeline.transform (/Users/yinz/Downloads/webpack-react-redux-react-router-master/node_modules/babel-core/lib/transformation/pipeline.js:46:16) at transpile (/Users/yinz/Downloads/webpack-react-redux-react-router-master/node_modules/babel-loader/index.js:38:20) at Object.module.exports (/Users/yinz/Downloads/webpack-react-redux-react-router-master/node_modules/babel-loader/index.js:131:12) @ multi main

Tushkiz commented 8 years ago

Which node version? Can you upgrade and try again.

brenopolanski commented 7 years ago

Well... my command build work fine, but when i'll run index.html it not render in browser.

screenshot from 2016-12-23 14-47-56

cemarguvanli commented 7 years ago

Any suggest about this issue?

cemarguvanli commented 7 years ago

Okay, guys, I figure out the problem. browserHistory does not work on prod

import { browserHistory } from 'react-router'; const history = syncHistoryWithStore(browserHistory, store);

change with this:

import { hashHistory } from 'react-router'; const history = syncHistoryWithStore(hashHistory, store);

brenopolanski commented 7 years ago

hey @cemarguvanli

thanks for your solution, it work for me :)

jpsierens commented 7 years ago

It should work with browserHistory if you run the dist folder on a server. From your screenshot I can see you are just navigating to it so it's not going to work that way (due to the routes).

hashHistory is not the preferred way to handle routes in production but it can do the trick when you are in dev mode and just want to check the output:

Hash history works without configuring your server, so if you're just getting started, go ahead and use it. In general, though, production web applications should use browserHistory for the cleaner URLs, and for support for server-side rendering, which is impossible with hashHistory.

check https://github.com/ReactTraining/react-router/blob/master/docs/guides/Histories.md#browserhistory for more info.