-
Notifications
You must be signed in to change notification settings - Fork 77
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
SSR fails #71
Comments
Hello, can you provide exact steps to reproduce, so we'll be able to investigate the issue? Code samples also will be appreciated. |
..... |
Hello, Thank you for your reply.. This is my latest trying. |
@Star0422 are you trying to render the editor on server and return it to the browser? As such I think that this will not work as the editor must be instantiated on the browser. If it is not a case please explain more clearly what you try to achieve? What framework are you using. Also some details on environment setup (node version, browser, etc) might be also helpful. |
Could be a duplicate of ckeditor/ckeditor5#1511. Also, what does the webpack config look like? Are the CKE5 dependencies transpiled? |
I am trying to render the editor on server. In webpack, "npm run dev" run well. But "npm start" still fails. Node and npm are latest version. The web app is based on Vuejs. So I tried the vue app with builder from source. |
This is package.json |
Trying to use CKEditor-vue in Nuxt app with enabled SSR.
|
unfortunatelly CKEditor module can't be even imported on server side, which makes impossible to make any workaroud except patching/rebuilding module itself UPDATE: ok there is one easy workaround for Nuxt. Registering ckeditor component and importing all stuff just from plugin with |
Can you be more specific? It's working indeed for the import of the CKEditor component, but I still have an issue when importing the editor itself in my component.
And since it's not possible for whatever reason to define the editors globally because of #9... |
Yes. You need to do following steps:
plugins/rich-editor.js
2 Register your plugin in nuxt config to be included only on client nuxt.config.js
components/RichEditor.vue
Because plugin is not loaded on server side, then will be just unknown tag causing no trouble. On client side, it's regular component registered globally by plugin and page will be rendered with CKEditor as wanted.. |
Thanks, it's working perfectly. PS: According to the Nuxt documentation, we should use |
@farin Hello there, I humbly thank for this great workaround for Nuxt, but if you can tell me, how to add plugins to Ck editor now? Thank you very |
You can add a plugin from a web interface and build new CKEditor package for your need, or fork its repo and clone it on local make changes according to docs which state how to load different plugins in the editor, after completing this stuff push your stuff in a new branch and update it on remote, I hope this helps you |
I tried ssr rendering via npm run build but I fails.
My project was a custom ckeditor building from source.
Below are error logs.
The text was updated successfully, but these errors were encountered: