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

Uncaught TypeError: Cannot read property 'updateDimVars' of undefined #33

Closed
captbaritone opened this issue Apr 15, 2018 · 0 comments
Closed
Labels

Comments

@captbaritone
Copy link

Using Webvs 2.0.2 from npm.

TLDR: I think this line is flawed because the handleResize method is not bound to the class instance.

I setup Webvs like so:

const analyser = new Webvs.WebAudioAnalyser({
    context: analyserNode.context
});
analyser.connectToNode(analyserNode);
this._webvsMain = new Webvs.Main({
    canvas: this._canvasNode,
    analyser: analyser
});
this._webvsMain.loadPreset(preset);
this._webvsMain.start();

Then at some point in the future, I update the canvas size and call:

this._webvsMain.notifyResize();

And I get the following error, because this is actually the event and not the DynamicMovement instance.

webvs.node.js:17667 Uncaught TypeError: Cannot read property 'updateDimVars' of undefined
    at Main.module.exports.DynamicMovement.handleResize (webvs.node.js:17667)
    at Main.emit (webvs.node.js:10809)
    at Main.module.exports.Main.notifyResize (webvs.node.js:7185)
[MY CODE BELOW HERE]
    at AvsWindow.componentDidUpdate (Webvs.js:31)
    at commitLifeCycles (react-dom.development.js:9706)
    at commitAllLifeCycles (react-dom.development.js:11349)
    at HTMLUnknownElement.callCallback (react-dom.development.js:104)
    at Object.invokeGuardedCallbackDev (react-dom.development.js:142)
    at invokeGuardedCallback (react-dom.development.js:191)
    at commitRoot (react-dom.development.js:11488)
@azeem azeem added the bug label Apr 15, 2018
@azeem azeem closed this as completed in fb94d8a Apr 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants