Git Product home page Git Product logo

reddice's People

Contributors

remchi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

reddice's Issues

loader issues

i ve whated video 3. i ve some problem about loaders. This issue ;
Asset Size Chunks Chunk Names
bundle.js 102 kB 0 main
chunk {0} bundle.js (main) 78 kB [rendered]
[0] multi main 40 bytes {0} [built] [1 error]
[1] .//html-entities/lib/html5-entities.js 49 kB {0} [built]
[2] ./
/ansi-html/index.js 4.26 kB {0} [built]
[3] .//ansi-regex/index.js 135 bytes {0} [built]
[4] ./
/html-entities/index.js 231 bytes {0} [built]
[5] .//html-entities/lib/html4-entities.js 6.59 kB {0} [built]
[6] ./
/html-entities/lib/xml-entities.js 2.99 kB {0} [built]
[7] ./~/strip-ansi/index.js 161 bytes {0} [built]
[8] (webpack)-hot-middleware/client-overlay.js 2.21 kB {0} [built]
[9] (webpack)-hot-middleware/client.js 7.77 kB {0} [built]
[10] (webpack)-hot-middleware/process-update.js 4.33 kB {0} [built]
[11] (webpack)/buildin/module.js 251 bytes {0} [built]

ERROR in multi main
Module not found: Error: Cannot resolve module 'react-hot' in D:\WorkSpace\Tutorals\ReactReduxTutorial
@ multi main

And i changed web.pack.config.dev.js

import path from 'path'
import webpack from 'webpack';

export default {
devtools: 'eval-source-map',
entry: [
'webpack-hot-middleware/client',
path.join(__dirname, '/client/index.js')
],
output: {
path: '/',
publicPath: '/'
},
plugins: [
new webpack.NoErrorsPlugin(),
new webpack.optimize.OccurenceOrderPlugin(),
new webpack.HotModuleReplacementPlugin()
],
module: {
loaders: [
{
test: /.js$/,
include: [
path.join(__dirname, 'client'),
path.join(__dirname, 'server/shared')
],
loaders: [ 'babel' ]
}
]
},
resolve: {
extentions: [ '', '.js' ]
}
}

   i only changed  "loaders: [ 'babel' ]" so my react's rendering need refresh every changes. How can i solve them ?

And here is my git repo ; https://github.com/abdullahsuhaisk/ReactRedux.git

Error with react-hot-loader - React & Redux #03. Project setup: Hot reloading setup

I'm getting this error, any idea ?

[nodemon] 1.10.2
[nodemon] to restart at any time, enter rs
[nodemon] watching: /Users/reddice/server/*/
[nodemon] starting babel-node server/index.js
Running on localhost:3000
webpack built 9640bc293e93cbce5554 in 341ms
Hash: 9640bc293e93cbce5554
Version: webpack 1.13.2
Time: 341ms
Asset Size Chunks Chunk Names
bundle.js 97.5 kB 0 main
chunk {0} bundle.js (main) 73.5 kB [rendered]
[0] multi main 40 bytes {0} [built] [1 error]
[1] .//html-entities/lib/html5-entities.js 49 kB {0} [built]
[2] ./
/ansi-html/index.js 4.02 kB {0} [built]
[3] .//ansi-regex/index.js 135 bytes {0} [built]
[4] ./
/html-entities/index.js 231 bytes {0} [built]
[5] .//html-entities/lib/html4-entities.js 6.57 kB {0} [built]
[6] ./
/html-entities/lib/xml-entities.js 2.98 kB {0} [built]
[7] ./~/strip-ansi/index.js 161 bytes {0} [built]
8-hot-middleware/client-overlay.js 1.74 kB {0} [built]
9-hot-middleware/client.js 4.49 kB {0} [built]
10-hot-middleware/process-update.js 3.88 kB {0} [built]
11/buildin/module.js 251 bytes {0} [built]

ERROR in ./client/index.js
Module build failed: Error: React Hot Loader: The Webpack loader is now exported separately. If you use Babel, we recommend that you remove "react-hot-loader" from the "loaders" section of your Webpack configuration altogether, and instead add "react-hot-loader/babel" to the "plugins" section of your .babelrc file. If you prefer not to use Babel, replace "react-hot-loader" or "react-hot" with "react-hot-loader/webpack" in the "loaders" section of your Webpack configuration.
at Object.warnAboutIncorrectUsage (/Users/reddice/node_modules/react-hot-loader/lib/index.js:7:11)
@ multi main

Validator: Lesson #9

I know you use validator since lesson 7 but I rechecked on the documentation provided in Validator NPM Package website and found that isEmpty function just take string as the argument.

In the code SignUp Validator, line 5, errors was declared as object, but it was tested as string at line 31, it throws error on me. So I initialized isValid as boolean with true as default value and tested it against all fields. if there was any input error then the value would change to false.

I get an error during Lesson 7

0.32d8846….hot-update.js:110 Uncaught (in promise) TypeError: Cannot read property 'username' of undefined(…)

As far as I can tell the errors state is empty.

this.props.userSignupRequest(this.state).then(
() => {},
({ data }) => this.setState({errors : data})
);
This function doesn't return anything. I tried to console.log(data) and I get undefined.

Am i doing something wrong?

installation

Tried to install and see errors
`> [email protected] start /Users/admin/Git/reddice

nodemon --watch server --exec babel-node -- server/index.js

[nodemon] 1.11.0
[nodemon] to restart at any time, enter rs
[nodemon] watching: /Users/admin/Git/reddice/server/**/*
[nodemon] starting babel-node server/index.js
Running on localhost:3000
Knex:Error Pool2 - Error: connect ECONNREFUSED 127.0.0.1:5432
Knex:Error Pool2 - Error: connect ECONNREFUSED 127.0.0.1:5432
webpack built 549ce7770cb1db2dac62 in 4571ms

Unhandled rejection Error: Pool is destroyed
at Pool.acquire (/Users/admin/Git/reddice/node_modules/pool2/lib/pool.js:162:12)
at /Users/admin/Git/reddice/node_modules/knex/src/client.js:212:29
at Promise._execute (/Users/admin/Git/reddice/node_modules/bluebird/js/release/debuggability.js:300:9)
at Promise._resolveFromExecutor (/Users/admin/Git/reddice/node_modules/bluebird/js/release/promise.js:483:18)
at new Promise (/Users/admin/Git/reddice/node_modules/bluebird/js/release/promise.js:79:10)
at Client.acquireConnection (/Users/admin/Git/reddice/node_modules/knex/src/client.js:208:23)
at /Users/admin/Git/reddice/node_modules/knex/src/runner.js:188:49
at Promise._execute (/Users/admin/Git/reddice/node_modules/bluebird/js/release/debuggability.js:300:9)
at Promise._resolveFromExecutor (/Users/admin/Git/reddice/node_modules/bluebird/js/release/promise.js:483:18)
at new Promise (/Users/admin/Git/reddice/node_modules/bluebird/js/release/promise.js:79:10)
at /Users/admin/Git/reddice/node_modules/knex/src/runner.js:187:35
at tryCatcher (/Users/admin/Git/reddice/node_modules/bluebird/js/release/util.js:16:23)
at Function.Promise.attempt.Promise.try (/Users/admin/Git/reddice/node_modules/bluebird/js/release/method.js:39:29)
at Runner.ensureConnection (/Users/admin/Git/reddice/node_modules/knex/src/runner.js:186:23)
at Runner.run (/Users/admin/Git/reddice/node_modules/knex/src/runner.js:27:31)
at QueryBuilder.Target.then (/Users/admin/Git/reddice/node_modules/knex/src/interface.js:22:45)

Unhandled rejection Error: Pool is destroyed
at Pool.acquire (/Users/admin/Git/reddice/node_modules/pool2/lib/pool.js:162:12)
at /Users/admin/Git/reddice/node_modules/knex/src/client.js:212:29
at Promise._execute (/Users/admin/Git/reddice/node_modules/bluebird/js/release/debuggability.js:300:9)
at Promise._resolveFromExecutor (/Users/admin/Git/reddice/node_modules/bluebird/js/release/promise.js:483:18)
at new Promise (/Users/admin/Git/reddice/node_modules/bluebird/js/release/promise.js:79:10)
at Client.acquireConnection (/Users/admin/Git/reddice/node_modules/knex/src/client.js:208:23)
at /Users/admin/Git/reddice/node_modules/knex/src/runner.js:188:49
at Promise._execute (/Users/admin/Git/reddice/node_modules/bluebird/js/release/debuggability.js:300:9)
at Promise._resolveFromExecutor (/Users/admin/Git/reddice/node_modules/bluebird/js/release/promise.js:483:18)
at new Promise (/Users/admin/Git/reddice/node_modules/bluebird/js/release/promise.js:79:10)
at /Users/admin/Git/reddice/node_modules/knex/src/runner.js:187:35
at tryCatcher (/Users/admin/Git/reddice/node_modules/bluebird/js/release/util.js:16:23)
at Function.Promise.attempt.Promise.try (/Users/admin/Git/reddice/node_modules/bluebird/js/release/method.js:39:29)
at Runner.ensureConnection (/Users/admin/Git/reddice/node_modules/knex/src/runner.js:186:23)
at Runner.run (/Users/admin/Git/reddice/node_modules/knex/src/runner.js:27:31)
at QueryBuilder.Target.then (/Users/admin/Git/reddice/node_modules/knex/src/interface.js:22:45)

Unhandled rejection Error: Pool is destroyed
at Pool.acquire (/Users/admin/Git/reddice/node_modules/pool2/lib/pool.js:162:12)
at /Users/admin/Git/reddice/node_modules/knex/src/client.js:212:29
at Promise._execute (/Users/admin/Git/reddice/node_modules/bluebird/js/release/debuggability.js:300:9)
at Promise._resolveFromExecutor (/Users/admin/Git/reddice/node_modules/bluebird/js/release/promise.js:483:18)
at new Promise (/Users/admin/Git/reddice/node_modules/bluebird/js/release/promise.js:79:10)
at Client.acquireConnection (/Users/admin/Git/reddice/node_modules/knex/src/client.js:208:23)
at /Users/admin/Git/reddice/node_modules/knex/src/runner.js:188:49
at Promise._execute (/Users/admin/Git/reddice/node_modules/bluebird/js/release/debuggability.js:300:9)
at Promise._resolveFromExecutor (/Users/admin/Git/reddice/node_modules/bluebird/js/release/promise.js:483:18)
at new Promise (/Users/admin/Git/reddice/node_modules/bluebird/js/release/promise.js:79:10)
at /Users/admin/Git/reddice/node_modules/knex/src/runner.js:187:35
at tryCatcher (/Users/admin/Git/reddice/node_modules/bluebird/js/release/util.js:16:23)
at Function.Promise.attempt.Promise.try (/Users/admin/Git/reddice/node_modules/bluebird/js/release/method.js:39:29)
at Runner.ensureConnection (/Users/admin/Git/reddice/node_modules/knex/src/runner.js:186:23)
at Runner.run (/Users/admin/Git/reddice/node_modules/knex/src/runner.js:27:31)
at QueryBuilder.Target.then (/Users/admin/Git/reddice/node_modules/knex/src/interface.js:22:45)

`

#02. WebpackOptionsValidationError

I tried to run npm run server after following #2. Project Setup: Render react component. and got following error-
/home/***/Desktop/reactcont/node_modules/webpack/lib/webpack.js:19
throw new WebpackOptionsValidationError(webpackOptionsValidationErrors);

WebpackOptionsValidationError: Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.

  • configuration.resolve.extensions[0] should not be empty.
    at webpack (/home//Desktop/reactcont/node_modules/webpack/lib/webpack.js:19:9)
    at Object. (/home/
    /Desktop/reactcont/server/index.js:10:27)
    at Module._compile (module.js:541:32)
    at loader (/home//Desktop/reactcont/node_modules/babel-register/lib/node.js:144:5)
    at Object.require.extensions.(anonymous function) [as .js] (/home/
    /Desktop/reactcont/node_modules/babel-register/lib/node.js:154:7)
    at Module.load (module.js:456:32)
    at tryModuleLoad (module.js:415:12)
    at Function.Module._load (module.js:407:3)
    at Function.Module.runMain (module.js:575:10)
    at /home/***/Desktop/reactcont/node_modules/babel-cli/lib/_babel-node.js:155:24
    [nodemon] app crashed - waiting for file changes before starting...

TypeError: Cannot read property 'authorization' of undefined

Please this is the response i receive on trying to submit on localhost:3000/new-event when a user has login. Is anything wrong with the 'authorization' in /server/middlewares/authenticate.js.
Please help me out.

TypeError: Cannot read property 'authorization' of undefined
at exports.default (/home/union/onegram/server/middlewares/authenticate.js:9:33)
at Layer.handle [as handle_request] (/home/union/onegram/node_modules/express/lib/router/layer.js:95:5)
at next (/home/union/onegram/node_modules/express/lib/router/route.js:131:13)
at Route.dispatch (/home/union/onegram/node_modules/express/lib/router/route.js:112:3)
at Layer.handle [as handle_request] (/home/union/onegram/node_modules/express/lib/router/layer.js:95:5)
at /home/union/onegram/node_modules/express/lib/router/index.js:277:22
at Function.process_params (/home/union/onegram/node_modules/express/lib/router/index.js:330:12)
at next (/home/union/onegram/node_modules/express/lib/router/index.js:271:10)
at Function.handle (/home/union/onegram/node_modules/express/lib/router/index.js:176:3)
at router (/home/union/onegram/node_modules/express/lib/router/index.js:46:12)
at Layer.handle [as handle_request] (/home/union/onegram/node_modules/express/lib/router/layer.js:95:5)
at trim_prefix (/home/union/onegram/node_modules/express/lib/router/index.js:312:13)
at /home/union/onegram/node_modules/express/lib/router/index.js:280:7
at Function.process_params (/home/union/onegram/node_modules/express/lib/router/index.js:330:12)
at next (/home/union/onegram/node_modules/express/lib/router/index.js:271:10)
at /home/union/onegram/node_modules/body-parser/lib/read.js:129:5

TypeError: Cannot read property 'string' of undefined

  • Regarding the above error came up with the TextFieldGroup.js.
  • This worked for me
  • React is no more shipped with PropTypes. You will need to install it.
  • First install the prop-types package by running npm i prop-types --save.
  • Next use the prop-types package into your component like this:
import React from 'react'
import PropTypes from 'prop-types'

export const AwesomeComponent = props => {
    return(
        <h1>Hello {props.name}</h1>
    )
}

AwesomeComponent.propTypes = {
    name: PropTypes.string.isRequired
}

webpack.config.prod.js

I am new to webpack. I spend couple of hours to configure webpack.config.prod.js. but fail

I want to upload the changes to ## herokuapp.com.

Will you please add webpack.config.prod.js file so i can use

git push heroku master

to see the changes online.

Thanks

Server side render

Hi,

What other things i'll need to do if i need the same code to run serverside to handle seo data too.

Please help.

Thanks,
Pradeep

Your configuration of react-hot is deprecated

Hi,
While doing your tutorial i got a problem with configuration:

ERROR in ./client/index.jsx
Module build failed: Error: React Hot Loader: The Webpack loader is now exported separately. If you use Babel, we
recommend that you remove "react-hot-loader" from the "loaders" section of your Webpack configuration altogether,
and instead add "react-hot-loader/babel" to the "plugins" section of your .babelrc file. If you prefer not to use
Babel, replace "react-hot-loader" or "react-hot" with "react-hot-loader/webpack" in the "loaders" section of your
Webpack configuration.

My solution (.babelrc):


{
  "presets": ...(your presets)
  "env": {
    "development": {
      "presets": ["react-hmre"]
    }
  }
}

Also you can look at this

I hope my solution will be useful for some of developers :)

Handle error jwtDecode

https://github.com/Remchi/reddice/blob/master/client/index.js#L24

jwtDecode can throw an error if a not valid token is passed, how do you suggest handling this?

for now I've created utils/decodeToken.js with:

import jwtDecode from 'jwt-decode';

export default function decodeToken(token) {
  let decoded = {};
  try {
    decoded = jwtDecode(token);
  } catch (err) {
  }
  return decoded;
};

and in index.js just call it instead of jwtDecode

import decodeToken from './utils/decodeToken';
...
store.dispatch(setCurrentUser(decodeToken(localStorage.jwtToken)));

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.