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

ReferenceError: window is not defined #9

Open
mushonnip opened this issue Dec 10, 2020 · 10 comments
Open

ReferenceError: window is not defined #9

mushonnip opened this issue Dec 10, 2020 · 10 comments

Comments

@mushonnip
Copy link

 ERROR  [Vue warn]: Failed to resolve async component: () => Promise.resolve(/*! import() */).then(__webpack_require__.t.bind(null, /*! @blowstack/ckeditor-nuxt */ "@blowstack/ckeditor-nuxt", 7))
Reason: ReferenceError: window is not defined
@blowstack
Copy link
Owner

where it's displayed? In browser console or in system console?

@mushonnip
Copy link
Author

where it's displayed? In browser console or in system console?

in the system console

@blowstack
Copy link
Owner

I assume it's shown when you refresh the page.
It shouldn't affect anything really. Does the editor work?

@mushonnip
Copy link
Author

I assume it's shown when you refresh the page.
It shouldn't affect anything really. Does the editor work?

The editor is work but it's like rendered slowly

@blowstack
Copy link
Owner

Yes, it's quite slow because It has mplemented all free plugins from ckeditor (except ckfinder). You can try to exclude plugins that you don't need passing a proper config. For example to disable Title plugin you can pass sth like this:

editorConfig: {
       removePlugins: ['Title'],
     }

If it doesn't help I recommend making your own custom build with selected plugins that way you shoud get a lighter version.

@mushonnip
Copy link
Author

Yes, it's quite slow because It has mplemented all free plugins from ckeditor (except ckfinder). You can try to exclude plugins that you don't need passing a proper config. For example to disable Title plugin you can pass sth like this:

editorConfig: {
       removePlugins: ['Title'],
     }

If it doesn't help I recommend making your own custom build with selected plugins that way you shoud get a lighter version.

Can we get the state when the ckeditor is ready? For content loader usage

@andymark-by
Copy link
Contributor

Have this problem too!
That what I see in terminal when use npm run dev?
Снимок экрана 2021-02-02 в 10 48 15

@andymark-by
Copy link
Contributor

andymark-by commented Feb 2, 2021

Have this problem too!
That what I see in terminal when use npm run dev?
Снимок экрана 2021-02-02 в 10 48 15

I found the answer! You need to add the process.client check like this, and the error will disappear.

export default {
  components: {
    'ckeditor-nuxt': () => { if (process.client) { return import('@blowstack/ckeditor-nuxt') } },
  },
}

@blowstack
Copy link
Owner

@andymark-by Good job. I've just merged your pull request. thx

@andymark-by
Copy link
Contributor

@blowstack Thank you for the good module.

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

3 participants