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

CKEditor 5 Initial Setup Error #1320

Closed
pkhodaveissi opened this issue Oct 20, 2018 · 1 comment
Closed

CKEditor 5 Initial Setup Error #1320

pkhodaveissi opened this issue Oct 20, 2018 · 1 comment
Labels
resolution:duplicate This issue is a duplicate of another issue and was merged into it.

Comments

@pkhodaveissi
Copy link

This is my setup via latest create-react-app :

import React, { Component } from "react";
import CKEditor from "@ckeditor/ckeditor5-react";
import ClassicEditor from "@ckeditor/ckeditor5-build-classic";

class App extends Component {
  render() {
    return (
      <div className="App">
        <h2>Using CKEditor 5 build in React</h2>
        <CKEditor
          editor={ClassicEditor}
          data="<p>Hello from CKEditor 5!</p>"
          onInit={editor => {
            // You can store the "editor" and use when it is needed.
            console.log("Editor is ready to use!", editor);
          }}
          onChange={(event, editor) => {
            const data = editor.getData();
            console.log({ event, editor, data });
          }}
        />
      </div>
    );
  }
}

export default App;

It logs this :

TypeError: Cannot read property '0' of undefined
    at Object.to (ckeditor.js:1439)
@ma2ciek
Copy link
Contributor

ma2ciek commented Oct 20, 2018

Hi, @pkhodaveissi!

It's a babel issue described in facebook/create-react-app#5387 and ckeditor/ckeditor5-react#41. In short, some babel transformation doesn't work correctly on our codebase.

Because of that bug, the create-react-app@2 isn't supported yet. Please, try the create-react-app@1.

@ma2ciek ma2ciek closed this as completed Oct 20, 2018
@ma2ciek ma2ciek added the resolution:duplicate This issue is a duplicate of another issue and was merged into it. label Oct 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
resolution:duplicate This issue is a duplicate of another issue and was merged into it.
Projects
None yet
Development

No branches or pull requests

2 participants