Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't add property context, object is not extensible #24

Open
joaomilho opened this issue Apr 4, 2015 · 5 comments
Open

Can't add property context, object is not extensible #24

joaomilho opened this issue Apr 4, 2015 · 5 comments

Comments

@joaomilho
Copy link

Hey guys, I'm using React 0.13.1, along with Babel+Browserify. My source is:

let React = require('react');
let ReactD3 = require('react-d3-components');
let AreaChart = ReactD3.AreaChart;

let data = [
  {
    label: 'somethingA',
    values: [{x: 0, y: 2}, {x: 1.3, y: 5}, {x: 3, y: 6}, {x: 3.5, y: 6.5}, {x: 4, y: 6}, {x: 4.5, y: 6}, {x: 5, y: 7}, {x: 5.5, y: 8}]
  },
  {
    label: 'somethingB',
    values: [{x: 0, y: 3}, {x: 1.3, y: 4}, {x: 3, y: 7}, {x: 3.5, y: 8}, {x: 4, y: 7}, {x: 4.5, y: 7}, {x: 5, y: 7.8}, {x: 5.5, y: 9}]
  }
];

React.render(<AreaChart
  data={data}
  width={400}
  height={400}
  margin={{top: 10, bottom: 50, left: 50, right: 10}}/>,
  document.body);

And I compile it with:

browserify src/file.es6 -t babelify --outfile dist/file.js

I see everything getting compiled correctly, but I got the "Can't add property context, object is not extensible". Any idea?

@joaomilho
Copy link
Author

There's something really wrong here. When I opened the package.json of your lib, the version is 0.4.6 and react's version is 0.12.2, while on Github you have react 0.13.1 but the SAME version of the lib. Whaaaat?

@joaomilho
Copy link
Author

Amazing, now I installed directly from github. The package points to the right React version (0.13.1) but now both webpack and browserify can't find the lib, since there's no index.js and package points to lib/index.js, which doesn't exist (as far as I understand is removed before build). ......

@codesuki
Copy link
Owner

codesuki commented Apr 4, 2015

Hey! Thanks for the report! The version on Github has React 0.13.1 since some days ago but I did not yet release a new NPM version. I will publish the new version first thing monday morning!
In the meanwhile what you can do is git clone this repository and then npm install /path/to/repository, then the lib folder will be created and installed into your project. Hope that helps!

@joaomilho
Copy link
Author

Hey, thanks for the response and sorry for the frustration :D. Cloning worked. LMK when there's a new version.

@codesuki
Copy link
Owner

codesuki commented Apr 6, 2015

Glad it worked out.
New npm version uploaded! Please have a try :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants