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

Does not work with react-scripts 2.0.4 #41

Closed
desaifly opened this issue Oct 9, 2018 · 10 comments
Closed

Does not work with react-scripts 2.0.4 #41

desaifly opened this issue Oct 9, 2018 · 10 comments
Labels
resolution:duplicate This issue is a duplicate of another issue and was merged into it. type:bug

Comments

@desaifly
Copy link

desaifly commented Oct 9, 2018

I upgraded react-scripts to 2.0.4 and Ckeditor stopped working. It produces empty div. Following are package.json and react component.

package.json:

{
  "name": "blank",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "@ckeditor/ckeditor5-build-classic": "^11.0.1",
    "@ckeditor/ckeditor5-react": "^1.0.0-beta.1",
    "react": "^16.5.2",
    "react-dom": "^16.5.2",
    "react-router-dom": "^4.3.1",
    "react-scripts": "^2.0.4"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test --env=jsdom",
    "eject": "react-scripts eject"
  },
  "browserslist": [
    ">0.2%",
    "not dead",
    "not ie <= 11",
    "not op_mini all"
  ]
}

Simple react code:

import * as React from 'react';
import { HashRouter} from 'react-router-dom';
import CKEditor from '@ckeditor/ckeditor5-react';
import BalloonEditor from '@ckeditor/ckeditor5-build-classic';


export class Main extends React.Component {
    constructor(props) {
        //console.log( ' IN THE Constructor' );
        super(props);
                
    }

    render() {
                return (
            
            <HashRouter>
                <div className="container d-flex flex-column">
                    <div>CKEditor:
                        
                    <CKEditor editor={BalloonEditor} data={'Test Test Test'}
                    />
                    </div>

                </div>
            </HashRouter>
        );

    }

}
@pomek
Copy link
Member

pomek commented Oct 9, 2018

It does not work because RCA transpiling an application to ES5. I'm trying to resolve the issue but at this moment I don't have any working solution.

@pomek
Copy link
Member

pomek commented Oct 9, 2018

But would be good to see your error from the console. You may have something other than me and my assumption could be incorrect.

@pomek pomek self-assigned this Oct 9, 2018
@pomek pomek added this to the iteration 21 milestone Oct 9, 2018
@desaifly
Copy link
Author

desaifly commented Oct 9, 2018

One of the issue I faced was that, the code compiles without any error in start and build mode. The only way to notice the change is the empty div.

Since you asked, I was looking for error and found an error in the declaration.
image

I thought react-scripts 2.0.x supports ES6.

@ma2ciek
Copy link
Contributor

ma2ciek commented Oct 9, 2018

Hi @desaifly,

You posted a TypeScript error and I guess it's not connected to the react-scripts library. If you're using TypeScript + React, you should add an empty declaration for the ckeditor5-react as we do not support TypeScript's typings at this moment.

@ma2ciek
Copy link
Contributor

ma2ciek commented Oct 9, 2018

Or it's just a prompt from your IDE that supports TypeScript.

@desaifly
Copy link
Author

Hi @ma2ciek

Your second comment is correct. This is a prompt from VS Code. I opened the project in the Atom IDE and does not show the error.

@pomek
Copy link
Member

pomek commented Oct 10, 2018

So, an important question is – does your application work correctly? Can you open a browser and see the editor?

@desaifly
Copy link
Author

desaifly commented Oct 10, 2018

My rest of the app works fine. I also created a new react project with only Ckeditor. It works fine if I use react-script 1.5.1; however when I upgraded to 2.0.4, the console gave following error.

TypeError: Cannot read property '0' of undefined
    at Object.to (ckeditor.js:1276)
    at new Rs (ckeditor.js:12540)
    at new Ru (ckeditor.js:21738)
    at new Gu (ckeditor.js:22818)
    at Wb.Yu (ckeditor.js:23106)
    at Wb.Uh (ckeditor.js:25015)
    at new Wb (ckeditor.js:33718)
    at ckeditor.js:25053
    at new Promise (<anonymous>)
    at Function.create (ckeditor.js:25052)
    at t.value (ckeditor.js:136)
    at t.value (ckeditor.js:115)
    at commitLifeCycles (react-dom.development.js:15354)
    at commitAllLifeCycles (react-dom.development.js:16703)
    at HTMLUnknownElement.callCallback (react-dom.development.js:144)
    at Object.invokeGuardedCallbackDev (react-dom.development.js:193)
    at invokeGuardedCallback (react-dom.development.js:243)
    at commitRoot (react-dom.development.js:16879)
    at completeRoot (react-dom.development.js:18335)
    at performWorkOnRoot (react-dom.development.js:18257)
    at performWork (react-dom.development.js:18159)
    at performSyncWork (react-dom.development.js:18132)
    at requestWork (react-dom.development.js:18009)
    at scheduleWork (react-dom.development.js:17802)
    at scheduleRootUpdate (react-dom.development.js:18523)
    at updateContainerAtExpirationTime (react-dom.development.js:18549)
    at updateContainer (react-dom.development.js:18580)
    at ReactRoot.push../node_modules/react-dom/cjs/react-dom.development.js.ReactRoot.render (react-dom.development.js:18862)
    at react-dom.development.js:19016
    at unbatchedUpdates (react-dom.development.js:18397)
    at legacyRenderSubtreeIntoContainer (react-dom.development.js:19012)
    at Object.render (react-dom.development.js:19076)
    at Module../src/index.js (index.js:8)
    at __webpack_require__ (bootstrap:782)
    at fn (bootstrap:150)
    at Object.0 (registerServiceWorker.js:117)
    at __webpack_require__ (bootstrap:782)
    at checkDeferredModules (bootstrap:45)
    at Array.webpackJsonpCallback [as push] (bootstrap:32)
    at main.chunk.js:1
function.console.(anonymous function) @ index.js:1452
(anonymous) @ ckeditor.js:141

@pomek
Copy link
Member

pomek commented Oct 11, 2018

See facebook/create-react-app#5387.

I have the same error. Unfortunately, I don't have any idea how to resolve it at this moment.

@Reinmar
Copy link
Member

Reinmar commented Nov 14, 2018

Let's continue this thread in #40 because these are duplicates.

@Reinmar Reinmar closed this as completed Nov 14, 2018
@Reinmar Reinmar added the resolution:duplicate This issue is a duplicate of another issue and was merged into it. label Nov 14, 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. type:bug
Projects
None yet
Development

No branches or pull requests

4 participants