Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialSaqib Ishfaq
13,912 Pointsnot rendering the application and getting this error in console>>>
Context.js:10 Uncaught TypeError: _react.default.createContext is not a function
at Object.<anonymous> (Context.js:10)
at __webpack_require__ (bootstrap 07a6edc6a165a4397740:555)
at fn (bootstrap 07a6edc6a165a4397740:86)
at Object.<anonymous> (Provider.js:16)
at __webpack_require__ (bootstrap 07a6edc6a165a4397740:555)
at fn (bootstrap 07a6edc6a165a4397740:86)
at Object.<anonymous> (index.js:7)
at __webpack_require__ (bootstrap 07a6edc6a165a4397740:555)
at fn (bootstrap 07a6edc6a165a4397740:86)
at Object.<anonymous> (index.js:3)
3 Answers
shi zhen
3,339 PointsI've got the same error while following along. What I've done to fix it are following:
- Update packs to the newest versions (npm outdated, npm update --save PACK_NAME)
- Comment out 'react-hot' in webpack.config.js as this will give you error when you 'npm start'
- At all those files that imported 'PropTypes' from react, move them outside to it's own library (ref. https://stackoverflow.com/questions/42542540/react2-default-proptypes-function-is-undefined)
David Hamilton
21,522 PointsThe issue is with using a newer version of react-redux with an old version of react.
You can get it to work by going into the package.json and changing the react-redux version to "^5.0.0".
John Nguyen
Full Stack JavaScript Techdegree Graduate 30,501 PointsI had the same issue. It (most likely) has to do with your react-redux and redux versions.
I solved the issue by
1) downloading the project files(for this video) and copying the package.json file from the 'final' version of this video.
Package.json
{
"name": "react-redux-course",
"version": "1.0.0",
"description": "React-Redux course for Treehouse",
"main": "src/index.js",
"scripts": {
"prestart": "npm run lint",
"start": "webpack-dev-server --progress --inline --hot",
"lint": "eslint ./src/**/*.{js, jsx} --fix",
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [
"react",
"redux",
"treehouse"
],
"author": "Beau Palmquist",
"license": "MIT",
"dependencies": {
"react": "^15.3.2",
"react-dom": "^15.3.2",
"react-redux": "^4.4.5",
"redux": "^3.6.0"
},
"devDependencies": {
"babel-core": "^6.13.2",
"babel-eslint": "^6.1.2",
"babel-loader": "^6.2.7",
"babel-preset-es2015": "^6.13.2",
"babel-preset-react": "^6.11.1",
"babel-preset-stage-0": "^6.5.0",
"eslint": "^3.3.1",
"eslint-plugin-react": "^6.1.2",
"react-hot-loader": "^1.3.0",
"webpack": "^1.13.2",
"webpack-dev-server": "^1.16.2"
}
}
2) running npm i
And that should fix the issue.
If you are still running into issues, you'd want to check your code compared to the 'final' version of this video's code. I had to do this and I used diffchecker.com to compare my code to the 'final' version.
Daniel Baker
15,369 PointsDaniel Baker
15,369 PointsSame here, any luck?