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

[CKEDITOR.resourceManager.load] Resource name "default" was not found #258

Open
aroshanzamir opened this issue May 11, 2024 · 0 comments
Open

Comments

@aroshanzamir
Copy link

aroshanzamir commented May 11, 2024

sometimes I get the following error:
Uncaught Error: [CKEDITOR.resourceManager.load] Resource name "default" was not found at "https://cdn.ckeditor.com/4.12.1/full-all/styles.js?t=J5S7".

editor-error

and sometimes I get the following:
editor-error-4

My problem is that sometimes it gives this error.

This is my editor config:

public getCKEditorConfig(direction: "rtl" | "ltr" = "rtl", plugins: string[] = [], type: CKEditorFormatType = "Advanced"): any {

        let removedItems: string = "Source,Templates,Save,NewPage,Print,Replace,Scayt,SelectAll,Form,Radio,TextField,Textarea,Select,Button,ImageButton,HiddenField,Blockquote,CreateDiv,Language,Image,Flash,Table,HorizontalRule,Smiley,SpecialChar,PageBreak,Iframe,ShowBlocks,About,Checkbox,Find,Preview,Styles,Format,Anchor,Maximize,CopyFormating"
        switch (type) {
            case "Advanced":
                break;

            case "Basic":
                removedItems += `,FontFormat,Font,Styles,Format,FontSize,Link,Unlink,TextColor,BGColor,Copy,Cut,Paste,Undo,Redo,Print,Form,TextField,Textarea,Button,SelectAll,CreateDiv,Table,PasteText,PasteFromWord,Select,HiddenField,Maximize,ShowBlocks,Image,Flash,Table,HorizontalRule,Smiley,SpecialChar,PageBreak,Iframe,-,Blockquote,CreateDiv,-,BidiLtr,BidiRtl,Subscript,Superscript,-,RemoveFormat,Form,Checkbox, Radio,TextField,Textarea,Select,Button,ImageButton,HiddenField,Unlink,CopyFormatting`
                break;

            case "Empty":
                removedItems += `,Copy,Cut,Paste,Undo,Redo,Print,Form,TextField,Textarea,Button,SelectAll,NumberedList,BulletedList,CreateDiv,Table,PasteText,PasteFromWord,Select,HiddenField,Styles,Format,FontSize,TextColor,BGColor,Maximize,ShowBlocks,Image,Flash,Table,HorizontalRule,Smiley,SpecialChar,PageBreak,Iframe,NumberedList,BulletedList,-,Outdent,Indent,-,Blockquote,CreateDiv,-,JustifyLeft,JustifyCenter,JustifyRight,JustifyBlock,-,BidiLtr,BidiRtl,Bold,Italic,Underline,Strike,Subscript,Superscript,-,RemoveFormat,Form,Checkbox, Radio,TextField,Textarea,Select,Button,ImageButton,HiddenField,Link,Unlink,Anchor,FontFormat,Font,CopyFormatting`
                break;
        }

        const config = {
            allowedContent: false,
            forcePasteAsPlainText: false,
            language: 'en',
            contentsLangDirection: direction,
            font_style: {
                overrides: [{ element: 'font', attributes: { 'face': null } }]
            },
            extraPlugins: `${plugins ? [...plugins, 'divarea'].toString() : 'divarea'}`, //strinsert
            removeButtons: removedItems,
            baseFloatZIndex: 9999999999
        }

        if (direction == "rtl") config.language = "fa"
        return config
 }

and I added the following scripts in the index.html:

<script src="https://cdn.ckeditor.com/4.12.1/full-all/ckeditor.js"></script>
  <script src="https://cdn.ckeditor.com/4.12.1/full-all/lang/fa.js"></script>
  <script src="https://cdn.ckeditor.com/4.12.1/full-all/lang/en.js"></script>

  <script>
    CKEDITOR.config.forcePasteAsPlainText = true;
    CKEDITOR.config.language = 'en'
  </script>

  • Browser: firefox or chrome
  • OS: windows 11
  • CKEditor version: "ckeditor4-angular": "^5.0.0"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant