ckeditor / ckeditor5

Powerful rich text editor framework with a modular architecture, modern integrations, and features like collaborative editing.
https://ckeditor.com/ckeditor-5
Other
9.54k stars 3.7k forks source link

e.on is not a function #2345

Closed thedavidmeister closed 5 years ago

thedavidmeister commented 6 years ago
screen shot 2017-12-07 at 1 37 14 am

getting this error simply calling create on a dom element.

using this https://cdn.ckeditor.com/ckeditor5/1.0.0-alpha.2/balloon/ckeditor.js

Reinmar commented 6 years ago

Hi! Sorry to hear that. Could you give more specifics on how you initialise the editor (with the surrouding HTML, JS, etc.)? Looking at the stack trace it can be pretty much everything unfortunately.

thedavidmeister commented 6 years ago
(ns ckeditor.hoplon
 (:require
  ckeditor.lib
  [hoplon.core :as h]
  [javelin.core :as j]))

(defn editor
 []
 (.log js/console js/BalloonEditor)

 (j/with-let [el (h/div "foo")]
  (.log js/console el)
  (js/BalloonEditor.create el)))

I'm just creating a div directly with and passing it straight to the editor, haven't even put it in the DOM yet so there's no surrounding HTML.

FWIW I saw the error with and without injecting the element in the document

thedavidmeister commented 6 years ago

looks like just calling:

(js/BalloonEditor.create (h/div))

is enough to trigger the error

Reinmar commented 6 years ago

I'm sorry, but we'll need JavaScript ;). Ideally, something that works on JSFiddle.

thedavidmeister commented 6 years ago

ok, i'll try tomorrow (after midnight here)

thedavidmeister commented 6 years ago

i cannot reproduce the issue on codepen https://codepen.io/anon/pen/BmeLjB?editors=0010

thedavidmeister commented 6 years ago

i cannot reproduce the issue on a minimal hoplon setup https://thedavidmeister.github.io/hoplon-ckeditor5-test/

the relevant code in this repo is:

   (j/with-let [el (h/div "foo edit me!")]
    (j/cell=
     (when ready?
      (js/BalloonEditor.create el)))))))
thedavidmeister commented 6 years ago

so now i wonder if some minified global is conflicting with some other minified global in my project.

Is there a way to get a non-minified version of the balloon editor build for me to test against?

Reinmar commented 6 years ago

CKEditor doesn't expose any globals except the BalloonEditor class. But if you want to try it anyway, please check https://docs.ckeditor.com/ckeditor5/latest/builds/guides/development/custom-builds.html and just comment this out https://github.com/ckeditor/ckeditor5-build-balloon/blob/3c67d9f5e5f8e685589702980b1c953f60be44b6/webpack.config.js#L36-L38.

thedavidmeister commented 6 years ago

I'm finding it somewhat difficult to get the build working, following the linked instructions.

I've raised multiple issues against https://github.com/ckeditor/ckeditor5-build-balloon

thedavidmeister commented 6 years ago

i've dropped everything in my app until the ckeditor appears correctly, i'll drop things back in one at a time until i find what the conflict is...

thedavidmeister commented 6 years ago

The issue seems to be a conflict with the Raven library provided by https://sentry.io - looking into a workaround...

thedavidmeister commented 6 years ago

upgrading to raven 3.20.1 seems to have fixed the issue