ckeditor / ckeditor5-collaboration-samples

Collaboration integration examples for CKEditor 5
Other
51 stars 101 forks source link

Throw error when 'npm run serve' \real-time-collaboration-for-vue. #9

Closed misterPeng closed 5 years ago

misterPeng commented 5 years ago

Error is as follows : `This relative module was not found:

The problem is solved by modify path of import.But a new error has occurred after construction in browser.

in .\node_modules\@ckeditor\ckeditor5-ui\src\icon\iconview.js

_updateXMLContent() {
     if ( this.content ) {

        const parsed = new DOMParser().parseFromString( this.content.trim(),'image/svg+xml' );
        const svg = parsed.querySelector( 'svg' );
        const viewBox = svg.getAttribute( 'viewBox' );

this.content === "img/previous-arrow.79ed695f.svg"; Lead to svg = null.Uncaught (in promise) TypeError: Cannot read property 'getAttribute' of null

ma2ciek commented 5 years ago

Hi @misterPeng.

Could you tell when the error occurs? Did you follow the installation guide? I've just downloaded the latest https://github.com/ckeditor/ckeditor5-collaboration-samples and I couldn't reproduce the issue.

misterPeng commented 5 years ago

Thank you for your reply.

I have found the cause of the error. In the vue.config.js ,Below line 46, must add: svgRule.uses.clear(). Otherwise import .svg return 'img/[filenNme].[md5].svg'. Sorry, my English is very bad, the expression may not be clear.

ma2ciek commented 5 years ago

Hi,

No worries, I understand you.

Probably the SVG loader that we demand was in conflict with your SVG loader. This is a common problem with webpack loaders and unfortunately, we can't provide the solution that will work for all cases. Glad you make it work.