Giter Club home page Giter Club logo

Comments (4)

openjck avatar openjck commented on August 16, 2024 1

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.

wlach avatar wlach commented on August 16, 2024 1

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.

openjck avatar openjck commented on August 16, 2024

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.

armenzg avatar armenzg commented on August 16, 2024

I'm hitting this.

from react-metrics-graphics.

Related Issues (17)

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.