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

Using Draftail with Rollup #399

Open
3 tasks done
yoongkang opened this issue Jul 29, 2020 · 0 comments
Open
3 tasks done

Using Draftail with Rollup #399

yoongkang opened this issue Jul 29, 2020 · 0 comments
Labels
question Further information is requested

Comments

@yoongkang
Copy link

Please make sure you have read available documentation and have searched for other resources available online before submitting your question here. Please also have a look at Draftail’s Help resources

Thanks!


Hi, thanks for all the work on Draftail, can't wait to try it out on Wagtail.

I'm trying to integrate Draftail into a React project using Rollup, but am having a bit of trouble. I'm new to rollup, so this could very well be a configuration error on my part, but would appreciate even just pointing me in the right direction.

Here's an example repo where I've used the example "Getting Started" code in a basic rollup project: https://github.com/yoongkang/draftail-rollup-problem

I'm getting an error when attempting to render DraftailEditor within a functional component. The error message says:

Uncaught Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: object.

Check the render method of `DraftailEditor`.

It looks like the import didn't resolve properly, but I'm having a bit of trouble tracking down exactly why. I get no errors when attempting to render a different component.

Also worth noting I'm not getting this error with the same code when I use CRA, so this is likely not a draftail bug. Probably low-priority if you're busy, but would be nice not to be stuck with Webpack.

Any pointers in the right direction would be very appreciated. Thank you again for all the hard work!


Which terms did you search for in the docs, issues, Stack Overflow?

  • Rollup
  • Draftail
  • Uncaught Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: object.
  • In the https://www.draftail.org/ documentation I searched for: Rollup.
  • In the issues / pull requests, I searched for: Rollup.
  • In Stack Overflow, I searched for: Rollup, DraftJS.
@yoongkang yoongkang added the question Further information is requested label Jul 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant