ckeditor5 icon indicating copy to clipboard operation
ckeditor5 copied to clipboard

Balloon editor fails when working with 'super' builds but works for inline

Open InputNeuron opened this issue 6 years ago • 11 comments

I'm tryin to build a ckeditor 'super' build with the balloon editor and the classic editor using these instructions for creating a "super build" ...

https://ckeditor.com/docs/ckeditor5/latest/builds/guides/integration/advanced-setup.html#creating-super-builds

... but I'm getting the following error:

ckeditorerror.js:64 Uncaught CKEditorError: ckeditor-duplicated-modules
Read more: https://ckeditor.com/docs/ckeditor5/latest/framework/guides/support/error-codes.html#error-ckeditor-duplicated-modules
    at Object.<anonymous> (http://localhost:63342/polar-app/packages/ckeditor5/packages/ckeditor5-build-classic/build/ckeditor.js:5:10576)
    at Object.<anonymous> (http://localhost:63342/polar-app/packages/ckeditor5/packages/ckeditor5-build-classic/build/ckeditor.js:5:10650)
    at n (http://localhost:63342/polar-app/packages/ckeditor5/packages/ckeditor5-build-classic/build/ckeditor.js:5:3571)
    at Module.<anonymous> (http://localhost:63342/polar-app/packages/ckeditor5/packages/ckeditor5-build-classic/build/ckeditor.js:5:463169)
    at n (http://localhost:63342/polar-app/packages/ckeditor5/packages/ckeditor5-build-classic/build/ckeditor.js:5:3571)
    at http://localhost:63342/polar-app/packages/ckeditor5/packages/ckeditor5-build-classic/build/ckeditor.js:5:4370
    at http://localhost:63342/polar-app/packages/ckeditor5/packages/ckeditor5-build-classic/build/ckeditor.js:5:4381
    at http://localhost:63342/polar-app/packages/ckeditor5/packages/ckeditor5-build-classic/build/ckeditor.js:5:3432
    at http://localhost:63342/polar-app/packages/ckeditor5/packages/ckeditor5-build-classic/build/ckeditor.js:5:3436

I have it working just fine with the 'inline' example and tested by loading sample/index.html (works fine)

If I make the following change though:

--- ckeditor-inline.js  2020-11-22 10:27:03.000000000 -0700
+++ ckeditor-balloon.js 2020-11-22 09:56:34.000000000 -0700
@@ -5,7 +5,7 @@
 
 // The editor creator to use.
 import ClassicEditorBase from '@ckeditor/ckeditor5-editor-classic/src/classiceditor';
-import InlineEditorBase from '@ckeditor/ckeditor5-editor-inline/src/inlineeditor';
+import BalloonEditorBase from '@ckeditor/ckeditor5-editor-balloon/src/ballooneditor';
 
 import Essentials from '@ckeditor/ckeditor5-essentials/src/essentials';
 import UploadAdapter from '@ckeditor/ckeditor5-adapter-ckfinder/src/uploadadapter';
@@ -33,7 +33,7 @@
 
 
 class ClassicEditor extends ClassicEditorBase {}
-class InlineEditor extends InlineEditorBase {}
+class BalloonEditor extends BalloonEditorBase {}
 
 const plugins = [
        Essentials,
@@ -63,7 +63,7 @@
 
 // Plugins to include in the build.
 ClassicEditor.builtinPlugins = plugins;
-InlineEditor.builtinPlugins = plugins;
+BalloonEditor.builtinPlugins = plugins;
 
 const config = {
        toolbar: {
@@ -108,8 +108,8 @@
 
 // Editor configuration.
 ClassicEditor.defaultConfig = config;
-InlineEditor.defaultConfig = config;
+BalloonEditor.defaultConfig = config;
 
 export default {
-       ClassicEditor, InlineEditor
+       ClassicEditor, BalloonEditor
 };

... then it won't work and I'll get the above error.

📝 Provide detailed reproduction steps (if any)

You can duplicate it by creating a super build with the instructions above, then applying the diff provided.

✔️ Expected result

a super build with balloon and classic

❌ Actual result

It fails with the given error.

📃 Other details

  • Browser: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.67 Safari/537.36
  • OS: MacOS Catalins
  • CKEditor version: 23.1.0
  • Installed CKEditor plugins: …

If you'd like to see this fixed sooner, add a 👍 reaction to this post.

InputNeuron avatar Nov 22 '20 17:11 InputNeuron

Hi, thanks for the report. Could you please check if it works for you after removing package-lock.json and reinstalling the packages? I also encoutered this error at first and this fixed the issue.

FilipTokarski avatar Nov 23 '20 09:11 FilipTokarski

@FilipTokarski nice.. will do that now and verify.

InputNeuron avatar Nov 23 '20 17:11 InputNeuron

@FilipTokarski alas, that did not fix the problem.

InputNeuron avatar Nov 23 '20 17:11 InputNeuron

Also, I removed all the plugins and plugin imports to see if that was part of the problem and it still fails.

InputNeuron avatar Nov 23 '20 17:11 InputNeuron

That's strange. Could you possibly prepare a GitHub repo or some other sample with your code, so we could look into this in more detail?

FilipTokarski avatar Nov 24 '20 08:11 FilipTokarski

I'll make our super build public...

InputNeuron avatar Nov 24 '20 18:11 InputNeuron

Should be here:

https://github.com/polar-app/ckeditor5

in the 'stable' branch.

this should duplicate the error:

cd packages/ckeditor5-build-classic
npm install
npm run build

then load samples/index.html in the browser

Then you should get the following error:

image

InputNeuron avatar Nov 24 '20 18:11 InputNeuron

I also added package-lock.json in case this is a weird NPM issue.

InputNeuron avatar Nov 24 '20 18:11 InputNeuron

Thanks for the sample. I cloned your app, switched to stable branch and tried installing and building the editor. First error that I got, was Webpack:

ERROR in ./src/ckeditor.js
Module not found: Error: Can't resolve '@ckeditor/ckeditor5-editor-balloon/src/ballooneditor'

So, I installed @ckeditor/ckeditor5-editor-balloon and ran npm run build again.

Then I launched http-server and went to localhost:8080/sample/index.html and I got working superbuild:

0_super1

The only weird thing is that it now shows the loaded content as raw html, instead of formatted.

FilipTokarski avatar Nov 25 '20 08:11 FilipTokarski

There has been no activity on this issue for the past two years. We've marked it as stale and will close it in 30 days. We understand it may be relevant, so if you're interested in the solution, leave a comment or reaction under this issue.

CKEditorBot avatar Sep 04 '23 05:09 CKEditorBot

We've closed your issue due to inactivity over the last year. We understand that the issue may still be relevant. If so, feel free to open a new one (and link this issue to it).

CKEditorBot avatar Oct 12 '23 05:10 CKEditorBot