Comments (4)
Here's my setup and the error that results.
index.js
var React = require('react');
var MG = require('react-metrics-graphics');
package.json
{
"dependencies": {
"react": "^16.0.0",
"react-metrics-graphics": "^0.6.2"
}
}
Node
$ node --version
v8.3.0
Running
$ node index
[...]/node_modules/react-metrics-graphics/lib/MetricsGraphics.js:94
obj[propertyName] = _react2['default'].PropTypes.any;
^
TypeError: Cannot read property 'any' of undefined
at /Users/john-moz/inbox/tmp/node_modules/react-metrics-graphics/lib/MetricsGraphics.js:94:51
at Array.reduce (<anonymous>)
at Object.<anonymous> (/Users/john-moz/inbox/tmp/node_modules/react-metrics-graphics/lib/MetricsGraphics.js:93:48)
at Module._compile (module.js:573:30)
at Object.Module._extensions..js (module.js:584:10)
at Module.load (module.js:507:32)
at tryModuleLoad (module.js:470:12)
at Function.Module._load (module.js:462:3)
at Module.require (module.js:517:17)
at require (internal/module.js:11:18)
from react-metrics-graphics.
Perhaps the best approach here is just to bump the required version of react to 15.3.0 (https://github.com/facebook/prop-types#compatibility) and make proptypes a peer dependency.
If you want to create a PR for this, feel free. Otherwise I'll probably get to it eventually!
from react-metrics-graphics.
Just wanted to add a couple of things for future reference:
- The correct peer dependency would be prop-types. Notice the dash. Confusingly, there's another node module without a dash that shouldn't be used in this case. I won't link to it here to avoid confusion.
- Users of react-metrics-graphics should note that just adding prop-types to their package.json won't be enough to support React 16. There will also need to be changes to react-metrics-graphics itself.
from react-metrics-graphics.
I'm hitting this.
from react-metrics-graphics.
Related Issues (17)
- Question: How handle this: interpolate: d3.curveLinear HOT 1
- How to use the target option HOT 2
- Few issues HOT 2
- create-react-app cannot create production build when react-metrics-graphics is being used HOT 3
- Module not found: Error: Cannot resolve module 'metrics-graphics' & 'metrics-graphics/dist/metricsgraphics.css' HOT 4
- List of options and validating them HOT 4
- Issues with required versions of peer dependencies (react, react-dom) HOT 1
- How to use xax_format option in react app? HOT 1
- Add zooming options HOT 2
- Mention adding metrics-graphics HOT 2
- Error: Cannot find module 'prop-types'
- Dependency Dashboard
- Urgent Facebook correspondence
- Remove jQuery from package.json dependencies HOT 6
- Title and description properties HOT 2
- Cannot set property 'row_number' of undefined HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-metrics-graphics.