chenglou / chenglou/react-motion

Uncaught TypeError: Illegal invocation

Open
#325 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
21.9k
Forks
1.1k
PR merge metrics
No merged PRs in 30d

Description

I'm getting an illegal invocation when I put slightly-modified code from `demo0-simpletransition` into my codebase.

Here's my code:

```

{ ({x}) => {
console.log(`this is x: ${x}`);
return



;
}
}

```

`show` is assigned to be either true or false in the render function, based off of a state property being != null.

Here's the full stacktrace:

```
Motion.js:118
Uncaught TypeError: Illegal invocation

startAnimationIfNecessary @ Motion.js:118
Motion_componentDidMount @ Motion.js:211
_assign.notifyAll @ CallbackQueue.js:66O
N_DOM_READY_QUEUEING.close @ ReactReconcileTransaction.js:79
Mixin.closeAll @ Transaction.js:202
Mixin.perform @ Transaction.js:149
Mixin.perform @ Transaction.js:136
_assign.perform @ ReactUpdates.js:89
flushBatchedUpdates @ ReactUpdates.js:165
ReactUpdates_flushBatchedUpdates @ ReactPerf.js:66
Mixin.closeAll @ Transaction.js:202
Mixin.perform @ Transaction.js:149
ReactDefaultBatchingStrategy.batchedUpdates @ ReactDefaultBatchingStrategy.js:63
enqueueUpdate @ ReactUpdates.js:194
enqueueUpdate @ ReactUpdateQueue.js:22
ReactUpdateQueue.enqueueSetState @ ReactUpdateQueue.js:201
ReactComponent.setState @ ReactComponent.js:67
_onChange @ hotness_view.jsx:118triggerEvents @ backbone-1.2.3.js:370
triggerApi @ backbone-1.2.3.js:356
eventsApi @ backbone-1.2.3.js:155
Events.trigger @ backbone-1.2.3.js:346
_.extend.set @ backbone-1.2.3.js:526
render @ home_hotness_view.jsx:205
initialize @ home_hotness_view.jsx:141
Backbone.View @ backbone-1.2.3.js:1192
ViewPlus @ backbone.shim.js:12
HomeHotnessView @ home_hotness_view.jsx:109(anonymous function) @ main_index_hotness.coffee:13
fire @ jquery-2.2.0.js:3182
self.fireWith @ jquery-2.2.0.js:3312
jQuery.extend.ready @ jquery-2.2.0.js:3531
completed @ jquery-2.2.0.js:3547
entrynav.jsx:596
```

The console.log does fire before the error occurs.

I combed through my npm dependencies, and I upgraded `babel` and `react` to match the ones in `react-motion`'s repo, but that didn't help.

Any idea? What should I investigate next?

Contributor guide

No contributing guide indexed for this repository

Research direction

Start at Motion.js:118, where the stack trace reports startAnimationIfNecessary, and compare the demo0-simpletransition usage with the provided Motion snippet. Reproduce the error with the shown render and state setup, then trace it through Motion_componentDidMount; done means the cause is identified and the behavior has a verified fix or documented reproduction.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.