tsaidavid / simple-redux-boilerplate Goto Github PK
View Code? Open in Web Editor NEWA simple, yet comprehensive React + Redux application, complete with DevTools.
A simple, yet comprehensive React + Redux application, complete with DevTools.
I noticed that when I try to use the object spread operator the parser throws an unexpected token error.
So something like this { ...persistedState, ...initialState } throws an error whereas Object.assign({}, persistedState, initialState) does not. I'm not sure why this would be the case since we are using babel with the 'react' and 'es2015' presets. Any ideas?
While trying to use the express server, i was somehow not able to debug apps in Chrome by setting breakpoints. I tried changing the devtool option within the config file as well to source-map, but it didnt work.
After that, i tried using webpack-dev-server and then i was able to debug the application within Chrome. Anyone else facing this issue while using express server rather than webpack-dev-server? I was using the branch: react-router-redux.
I'm getting the following error when I run npm run dev
:
$ npm run dev
> [email protected] dev /home/wooters/projects/simple-redux-boilerplate
> NODE_ENV=development npm start
> [email protected] start /home/wooters/projects/simple-redux-boilerplate
> node devServer.js
/home/wooters/projects/simple-redux-boilerplate/devServer.js:16
app.get('*', (req, res) => {
^
SyntaxError: Unexpected token >
at Module._compile (module.js:439:25)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:929:3
npm ERR! weird error 8
npm ERR! not ok code 0
npm ERR! weird error 1
npm ERR! not ok code 0
I followed the directions in the README.md, namely, I did:
$ cd simple-redux-boilerplate
$ npm install
$ npm run dev
That last step is what produced the error above.
I still see the DevTools panel when running production version. Is there anything I'm supposed to do in order to disable it?
Getting error:
Error: Expected the reducer to be a function. Instead got an object with a "default" field. Did you pass a module instead of the default export? Try passing require(...).default instead.
https://github.com/tsaiDavid/simple-redux-boilerplate/blob/master/webpack.config.dev.js#L40
Shouldn't /\.js?/
be /\.js$/
?
Where you would recommend putting and configuring your images folder in this project?
I'd like to serve some photos and some svg icons - I see that express creates a static directory for the bundle.js
Would an images directory be configured in webpack.config.dev.js or devServer.js?
request a TypeScript / TSX version
This is really nice, a welcome addition to the react-redux boilerplate generators. Quick comment: there are dozens of CSS preprocessors out there, and I would suggest not choosing one. Maybe show how to add one rather than baking it into the boilerplate?
Hello, I'm studying react and used your boilerplate.
I wanted to know how send to production, and how to run it.
Tks
Hi,
This is a great boilerplate to start from. One of the cleanest that I found. I currently have two issues and considering that you have on your agenda to add details on deploying production code and all that then I guess it's user issues.
I can't run "npm build prod". I'm getting an error that "\prod\package.json" was not found. Note that if I run the actual commands set for "npm build prod" then things work. I break it to two commands that work on their own:
npm run clean
npm run build:webpack
Once I get the generated JS file after build then when trying to run the code I'm getting a JS error "history.listen is not a function". It doesn't happen when I run the code in dev mode. Btw, I see that I'm not the only one having this issue with React/Redux: http://stackoverflow.com/questions/37697950/react-router-redux-history-listen-is-not-a-function
I'd appreciate any assistance with this.
Cheers!
logger and thunk middleware order in configure.dev.js is swapped , because of that if an async action is triggered an undefined action will be console.logged first.
none of the code is typescript, there shouldn't be any typescript dev dependencies.
Can you please minimize the package.json? It's confusing to figure out what's actually necessary and what isn't.
Just need to change line 13 to this:
class App extends Component {
then it works.
Great work, thanks for doing this!
Any thoughts on adding Flow ?
David
It looks like the App.js has two default exports.
ERROR in ./src/containers/App.js
Module build failed: SyntaxError: Only one default export allowed per module.
64 | */
65 |
66 | export default connect(
| ^
67 | mapStateToProps,
68 | mapDispatchToProps
69 | )(App);
When run 'npm run dev', I got:
ERROR in ./src/index.js
Module build failed: SyntaxError: Unexpected token (19:2)
17 |
18 | ReactDOM.render(
19 | ,
| ^
20 | document.getElementById('root')
21 | );
22 |
@ multi main
Thanks.
Kind of new to node and react. Followed the instructions, but see several errors when doing "npm run dev". All errors complain about module redux:
ERROR in ./src/store/configureStore.dev.js
Module not found: Error: Cannot resolve module 'redux' in /Users/mikemoore/code/nodejs/simple-redux-boilerplate/src/store
@ ./src/store/configureStore.dev.js 3:13-29
Using: npm version 3.10.10 and node 6.9.5
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.