JedWatson / react-tappable

Tappable component for React
http://jedwatson.github.io/react-tappable/
MIT License
862 stars 90 forks source link

Uncaught TypeError: Can't add property context, object is not extensible #5

Closed natew closed 9 years ago

natew commented 9 years ago

Just tried this in the reapp demo, and when I attempt to use the tag I get this. Figured I'd open this to see if you had any idea before I dug in.

I get this super long stack trace (and slowdown in the devtools):

Uncaught TypeError: Can't add property context, object is not extensibleReactCompositeComponent.js:136 ReactCompositeComponentMixin.mountComponentReactPerf.js:66 ReactPerf.measure.wrapperReactReconciler.js:38 ReactReconciler.mountComponentReactMultiChild.js:187 ReactMultiChild.Mixin.mountChildrenReactDOMComponent.js:251 ReactDOMComponent.Mixin._createContentMarkupReactDOMComponent.js:167 ReactDOMComponent.Mixin.mountComponentReactReconciler.js:38 ReactReconciler.mountComponentReactCompositeComponent.js:187 ReactCompositeComponentMixin.mountComponentReactPerf.js:66 ReactPerf.measure.wrapperReactReconciler.js:38 ReactReconciler.mountComponentReactCompositeComponent.js:187 ReactCompositeComponentMixin.mountComponentReactPerf.js:66 ReactPerf.measure.wrapperReactReconciler.js:38 ReactReconciler.mountComponentReactMultiChild.js:187 ReactMultiChild.Mixin.mountChildrenReactDOMComponent.js:251 ReactDOMComponent.Mixin._createContentMarkupReactDOMComponent.js:167 ReactDOMComponent.Mixin.mountComponentReactReconciler.js:38 ReactReconciler.mountComponentReactCompositeComponent.js:187 ReactCompositeComponentMixin.mountComponentReactPerf.js:66 ReactPerf.measure.wrapperReactReconciler.js:38 ReactReconciler.mountComponentReactCompositeComponent.js:187 ReactCompositeComponentMixin.mountComponentReactPerf.js:66 ReactPerf.measure.wrapperReactReconciler.js:38 ReactReconciler.mountComponentReactMultiChild.js:187 ReactMultiChild.Mixin.mountChildrenReactDOMComponent.js:251 ReactDOMComponent.Mixin._createContentMarkupReactDOMComponent.js:167 ReactDOMComponent.Mixin.mountComponentReactReconciler.js:38 ReactReconciler.mountComponentReactCompositeComponent.js:187 ReactCompositeComponentMixin.mountComponentReactPerf.js:66 ReactPerf.measure.wrapperReactReconciler.js:38 ReactReconciler.mountComponentReactMultiChild.js:187 ReactMultiChild.Mixin.mountChildrenReactDOMComponent.js:251 ReactDOMComponent.Mixin._createContentMarkupReactDOMComponent.js:167 ReactDOMComponent.Mixin.mountComponentReactReconciler.js:38 ReactReconciler.mountComponentReactCompositeComponent.js:187 ReactCompositeComponentMixin.mountComponentReactPerf.js:66 ReactPerf.measure.wrapperReactReconciler.js:38 ReactReconciler.mountComponentReactCompositeComponent.js:187 ReactCompositeComponentMixin.mountComponentReactPerf.js:66 ReactPerf.measure.wrapperReactReconciler.js:38 ReactReconciler.mountComponentReactMultiChild.js:187 ReactMultiChild.Mixin.mountChildrenReactDOMComponent.js:251 ReactDOMComponent.Mixin._createContentMarkupReactDOMComponent.js:167 ReactDOMComponent.Mixin.mountComponentReactReconciler.js:38 ReactReconciler.mountComponentReactCompositeComponent.js:187 ReactCompositeComponentMixin.mountComponentReactPerf.js:66 ReactPerf.measure.wrapperReactReconciler.js:38 ReactReconciler.mountComponentReactCompositeComponent.js:187 ReactCompositeComponentMixin.mountComponentReactPerf.js:66 ReactPerf.measure.wrapperReactReconciler.js:38 ReactReconciler.mountComponentReactMultiChild.js:187 ReactMultiChild.Mixin.mountChildrenReactDOMComponent.js:251 ReactDOMComponent.Mixin._createContentMarkupReactDOMComponent.js:167 ReactDOMComponent.Mixin.mountComponentReactReconciler.js:38 ReactReconciler.mountComponentReactCompositeComponent.js:187 ReactCompositeComponentMixin.mountComponentReactPerf.js:66 ReactPerf.measure.wrapperReactReconciler.js:38 ReactReconciler.mountComponentReactCompositeComponent.js:187 ReactCompositeComponentMixin.mountComponentReactPerf.js:66 ReactPerf.measure.wrapperReactReconciler.js:38 ReactReconciler.mountComponentReactCompositeComponent.js:187 ReactCompositeComponentMixin.mountComponentReactPerf.js:66 ReactPerf.measure.wrapperReactReconciler.js:38 ReactReconciler.mountComponentReactCompositeComponent.js:187 ReactCompositeComponentMixin.mountComponentReactPerf.js:66 ReactPerf.measure.wrapperReactReconciler.js:38 ReactReconciler.mountComponentReactMultiChild.js:187 ReactMultiChild.Mixin.mountChildrenReactDOMComponent.js:251 ReactDOMComponent.Mixin._createContentMarkupReactDOMComponent.js:167 ReactDOMComponent.Mixin.mountComponentReactReconciler.js:38 ReactReconciler.mountComponentReactCompositeComponent.js:187 ReactCompositeComponentMixin.mountComponentReactPerf.js:66 ReactPerf.measure.wrapperReactReconciler.js:38 ReactReconciler.mountComponentReactCompositeComponent.js:187 ReactCompositeComponentMixin.mountComponentReactPerf.js:66 ReactPerf.measure.wrapperReactReconciler.js:38 ReactReconciler.mountComponentReactMultiChild.js:187 ReactMultiChild.Mixin.mountChildrenReactDOMComponent.js:251 ReactDOMComponent.Mixin._createContentMarkupReactDOMComponent.js:167 ReactDOMComponent.Mixin.mountComponentReactReconciler.js:38 ReactReconciler.mountComponentReactCompositeComponent.js:187 ReactCompositeComponentMixin.mountComponentReactPerf.js:66 ReactPerf.measure.wrapperReactReconciler.js:38 ReactReconciler.mountComponentReactMultiChild.js:187 ReactMultiChild.Mixin.mountChildrenReactDOMComponent.js:251 ReactDOMComponent.Mixin._createContentMarkupReactDOMComponent.js:167 ReactDOMComponent.Mixin.mountComponentReactReconciler.js:38 ReactReconciler.mountComponentReactCompositeComponent.js:187 ReactCompositeComponentMixin.mountComponentReactPerf.js:66 ReactPerf.measure.wrapperReactReconciler.js:38 ReactReconciler.mountComponentReactCompositeComponent.js:187 ReactCompositeComponentMixin.mountComponentReactPerf.js:66 ReactPerf.measure.wrapperReactReconciler.js:38 ReactReconciler.mountComponentReactCompositeComponent.js:187 ReactCompositeComponentMixin.mountComponentReactPerf.js:66 ReactPerf.measure.wrapperReactReconciler.js:38 ReactReconciler.mountComponentReactCompositeComponent.js:187 ReactCompositeComponentMixin.mountComponentReactPerf.js:66 ReactPerf.measure.wrapperReactReconciler.js:38 ReactReconciler.mountComponentReactMultiChild.js:187 ReactMultiChild.Mixin.mountChildrenReactDOMComponent.js:251 ReactDOMComponent.Mixin._createContentMarkupReactDOMComponent.js:167 ReactDOMComponent.Mixin.mountComponentReactReconciler.js:38 ReactReconciler.mountComponentReactCompositeComponent.js:187 ReactCompositeComponentMixin.mountComponentReactPerf.js:66 ReactPerf.measure.wrapperReactReconciler.js:38 ReactReconciler.mountComponentReactCompositeComponent.js:187 ReactCompositeComponentMixin.mountComponentReactPerf.js:66 ReactPerf.measure.wrapperReactReconciler.js:38 ReactReconciler.mountComponentReactCompositeComponent.js:187 ReactCompositeComponentMixin.mountComponentReactPerf.js:66 ReactPerf.measure.wrapperReactReconciler.js:38 ReactReconciler.mountComponentReactCompositeComponent.js:187 ReactCompositeComponentMixin.mountComponentReactPerf.js:66 ReactPerf.measure.wrapperReactReconciler.js:38 ReactReconciler.mountComponentReactCompositeComponent.js:187 ReactCompositeComponentMixin.mountComponentReactPerf.js:66 ReactPerf.measure.wrapperReactReconciler.js:38 ReactReconciler.mountComponentReactMount.js:232 mountComponentIntoNode
natew commented 9 years ago

Ah, I'm on 0.13 that may be it.

JedWatson commented 9 years ago

I haven't tried it with 0.13 yet, will do soon.

nmn commented 9 years ago

I'm using it in 0.13 with no problems. The problem is probably reapp specific or maybe because of react context

JedWatson commented 9 years ago

Thanks for confirming @nmn, I'll leave it to @natew to look into further in reapp if it keeps happening, closing unless we can identify a problem specific to this module.

nmn commented 9 years ago

@JedWatson I'm sorry I made a mistake. I'm using it on 12.2. Not 0.13 please re-open the issue. Sorry for the confusion.

JedWatson commented 9 years ago

Ha, ok, no problem :)

nmn commented 9 years ago

That said, in the case of 0.13, this should really be implemented in the way of a higher order component (replacement for mixins)

Described here: https://gist.github.com/sebmarkbage

It should need minimal code change.

JedWatson commented 9 years ago

Can't reproduce this issue across multiple implementations, may be related to some other usage of context in reapp. Closing.

wmyers commented 9 years ago

FYI I got this error using react-tappable@0.2.5 with react-router@0.13.3. The error occurred when I implemented a <Tappable> in JSX and seemed to stem from react-router/Transition module. Updating to react-tappable@0.5.1 fixed the problem for me.

JedWatson commented 9 years ago

Thanks for the confirmation @wmyers, glad to know it's been resolved.