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

Module parse failed: Unexpected token (36:9). You may need an appropriate loader to handle this file type. #7

Closed
ghost opened this issue Jul 8, 2018 · 5 comments
Labels
pending:feedback This issue is blocked by necessary feedback.
Milestone

Comments

@ghost
Copy link

ghost commented Jul 8, 2018

I'm using this in package.json:

...
"cke5-react": "github:ckeditor/ckeditor5-react",
"@ckeditor/ckeditor5-build-classic": "10.1.0",
...

in my code this:

...
import CKEditor from "cke5-react/src/ckeditor";
import ClassicEditorBuild from "@ckeditor/ckeditor5-build-classic";
...

but it says:

./node_modules/cke5-react/src/ckeditor.js
Module parse failed: Unexpected token (36:9)
You may need an appropriate loader to handle this file type.
|       // Render <div> element which will be replaced by CKEditor.
|       render() {
|               return <div ref={ ref => ( this.domContainer = ref ) }></div>;
|       }
|

Why?

@pomek
Copy link
Member

pomek commented Jul 8, 2018

You need to attach JSX loader for the specific component file in your Webpack configuration.

@ghost
Copy link
Author

ghost commented Jul 8, 2018

I'm using create-react-app without ejecting.

@ghost
Copy link
Author

ghost commented Jul 8, 2018

If I copy the code in a component in my project everything works!

@pomek
Copy link
Member

pomek commented Jul 9, 2018

Could you install the package using the #t/5 branch?

It contains a lot of improvements required for the #5. The issue that you described shouldn't occur anymore.

@pomek pomek added the pending:feedback This issue is blocked by necessary feedback. label Jul 9, 2018
@ghost
Copy link
Author

ghost commented Jul 9, 2018

Yes it works with that branch. But the problem now is componentWillReceiveProps( newProps ) { which freeze my component at startup.

ma2ciek added a commit that referenced this issue Jul 24, 2018
Other: First developer preview version. It contains ready-to-use `CKEditor` component that allows using CKEditor 5 Builds and CKEditor 5 Framework in React application. Closes #1. Closes #3. Closes #5. Closes #7. Closes #13. Closes #15.
@Reinmar Reinmar added this to the iteration 20 milestone Aug 31, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pending:feedback This issue is blocked by necessary feedback.
Projects
None yet
Development

No branches or pull requests

2 participants