ckeditor5-vue icon indicating copy to clipboard operation
ckeditor5-vue copied to clipboard

Uncaught SyntaxError when integrating a build from the online builder when using `npm add file:./ckeditor5` in Vue

Open mabryl opened this issue 2 years ago • 7 comments

📝 Provide detailed reproduction steps (if any)

  1. Try to integrate a build from the online builder in accordance with our docs
  2. In the step that describes adding the package located in the ckeditor5 directory as a dependency, use npm instead of yarn like so: npm add file:./ckeditor5
  3. Run the app

✔️ Expected result

You should be able to see the editor running in Vue.

❌ Actual result

You get a blank page and an error in the console that reads: Uncaught SyntaxError: The requested module '/ckeditor5/build/ckeditor.js' does not provide an export named 'default' (at App.vue:8:10)

🤔 Additional details

As stated in the reproduction steps, this only happens when using npm. Using yarn via yarn add file:./ckeditor5 does not produce this issue.

Marking this as a regression because I'm fairly sure that npm add file:./ckeditor5 worked in an older version of the editor.

mabryl avatar Oct 27 '23 13:10 mabryl

@mabryl could you specify your npm and node version?

Witoso avatar Oct 27 '23 14:10 Witoso

Node v18.17.1 npm 9.6.7

Should I update and try again @Witoso?

mabryl avatar Oct 27 '23 14:10 mabryl

I don't think it would help. What's your bundler in the app? If it's vite, there may be some additional configuration needed. I think this is a bundler issue, and this worked in Angular/React docs, but doesn't in Vue due to different bundlers.

There's a resolved issue for this on SO.

Witoso avatar Oct 27 '23 14:10 Witoso

Yup, the bundler is the default one when using npm create vue@latest, so it's Vite.

I'll see if the issue persists when using webpack, for example.

mabryl avatar Oct 27 '23 14:10 mabryl

@Witoso I was able to use your link to get the editor to show up in the dev environment, but deploy, I get the error:

index-f0797983.js:1 TypeError: this.editor.create is not a function

DedicatedManagers avatar Oct 27 '23 19:10 DedicatedManagers

@DedicatedManagers could you also check the comment that was shared in our community with a config?

Witoso avatar Oct 30 '23 08:10 Witoso

@Witoso I was able to use your link to get the editor to show up in the dev environment, but deploy, I get the error:

index-f0797983.js:1 TypeError: this.editor.create is not a function

did you find any solution?

FrankyXie avatar Jul 24 '24 12:07 FrankyXie