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

Cannot read property 'unbind' of undefined #35

Closed
alexmyshchyshyn opened this issue Oct 21, 2018 · 3 comments
Closed

Cannot read property 'unbind' of undefined #35

alexmyshchyshyn opened this issue Oct 21, 2018 · 3 comments

Comments

@alexmyshchyshyn
Copy link

I installed "@tinymce/tinymce-react": "^2.3.0",
I wrote my own component following the documentation

import React from "react";
import { connect } from "react-redux";

import { Editor } from "@tinymce/tinymce-react";

/**Actions */
import { editorOnChange } from "../../../actions";

class CKEditor extends React.Component {
  handleEditorChange = (content) => {
    const {
      id,
      editorOnChange,
      reducer: { actionType },
    } = this.props;
    editorOnChange(actionType, id, content);
  };

  render() {
    return (
      <Editor
        apiKey="8g8nxiiua9o6rxmlgdkupdq0cwtn4ws1819v8typvr8opxb0"
        init={{
          plugins:"powerpaste",
          toolbar:
            "formatselect | paste | bold italic strikethrough forecolor backcolor | link | alignleft aligncenter alignright alignjustify  | numlist bullist outdent indent  | removeformat | fontselect | fontsizeselect",
          font_formats:
            "Andale Mono=andale mono,times;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Helvetica=helvetica;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Trebuchet MS=trebuchet ms,geneva;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats;Akzidenz-Grotesk Std=Akzidenz-Grotesk Std",
        }}
        value={this.props.value}
        onEditorChange={this.handleEditorChange}
      />
    );
  }
}

const mapDispatchToProps = {
  editorOnChange,
};

export default connect(
  null,
  mapDispatchToProps,
)(CKEditor);

I use this component at least at 3 different pages. When i'm load this component at first, it's all ok, no crashes, but when i want to change page to another, where editor component is use too, i have a crash and error at console

Uncaught TypeError: Cannot read property 'unbind' of undefined
    at Yx.<anonymous> (tinymce.min.js?apiKey=8g8nxiiua9o6rxmlgdkupdq0cwtn4ws1819v8typvr8opxb0:76)
    at Jg.c.fire (tinymce.min.js?apiKey=8g8nxiiua9o6rxmlgdkupdq0cwtn4ws1819v8typvr8opxb0:8)
    at Yx.fire (tinymce.min.js?apiKey=8g8nxiiua9o6rxmlgdkupdq0cwtn4ws1819v8typvr8opxb0:8)
    at rp (tinymce.min.js?apiKey=8g8nxiiua9o6rxmlgdkupdq0cwtn4ws1819v8typvr8opxb0:8)
    at qx (tinymce.min.js?apiKey=8g8nxiiua9o6rxmlgdkupdq0cwtn4ws1819v8typvr8opxb0:8)
    at Yx.remove (tinymce.min.js?apiKey=8g8nxiiua9o6rxmlgdkupdq0cwtn4ws1819v8typvr8opxb0:8)
    at Object.remove (tinymce.min.js?apiKey=8g8nxiiua9o6rxmlgdkupdq0cwtn4ws1819v8typvr8opxb0:8)
    at Editor.componentWillUnmount (Editor.js:71)
    at callComponentWillUnmountWithTimer (react-dom.development.js:14280)
    at HTMLUnknownElement.callCallback (react-dom.development.js:100)

It only happens when there is plugins property available. If i remove it, everything works good
Version of Tiny - "@tinymce/tinymce-react": "^2.3.0",

@fyrkant
Copy link
Contributor

fyrkant commented Oct 22, 2018

You were able to fix this in some way?

@fyrkant
Copy link
Contributor

fyrkant commented Oct 22, 2018

Is there a difference between this issue and the one you opened and closed earlier? Or maybe douple post caused by github having some technical problems today?

@alexmyshchyshyn
Copy link
Author

You were able to fix this in some way?
-No.

Is there a difference between this issue and the one you opened and closed earlier? Or maybe douple post caused by github having some technical problems today?
-Yes, it was bugs on github platform and this issue was closed, and i created new issue

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