ckeditor / ckeditor5

Powerful rich text editor framework with a modular architecture, modern integrations, and features like collaborative editing.
https://ckeditor.com/ckeditor-5
Other
9.51k stars 3.7k forks source link

Unknown file extension ".css" #16211

Closed mahovsson closed 6 months ago

mahovsson commented 6 months ago

Hello I have today migrated to 41.3.0 and I get same error as in (#16075) :

App is build on Vue3 + Vite + Ruby

āœ”ļø Expected result

Unit test pass successfully

āŒ Actual result

TypeError: Unknown file extension ".css" for /node_modules/@ckeditor/ckeditor5-editor-classic/theme/classiceditor.css.

šŸ“ƒ Other details

I tried suggestion from linked task , but still does not help any suggestions how to proceed?

export default defineConfig({
  /* ... */
  test: {
    /* ... */
    server: {
      deps: {
        inline: [/@ckeditor\/.*/i, /ckeditor5\/.*/i],
      },
    },
  },
});
System:
    OS: macOS 14.4.1
    CPU: (10) arm64 Apple M1 Pro
    Memory: 230.84 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 18.17.1 - ~/.nvm/versions/node/v18.17.1/bin/node
    Yarn: 4.1.1 - ~/.nvm/versions/node/v18.17.1/bin/yarn
    npm: 9.6.7 - ~/.nvm/versions/node/v18.17.1/bin/npm
  Browsers:
    Chrome: 123.0.6312.123
    Edge: 123.0.2420.97
    Safari: 17.4.1
  npmPackages:
    @vitejs/plugin-vue: ^5.0.3 => 5.0.4 
    @vitest/coverage-istanbul: ^1.1.3 => 1.3.1 
    vite: ^5.0.0 => 5.1.6 
    vitest: ^1.4.0 => 1.4.0 

Package.json

"@ckeditor/ckeditor5-adapter-ckfinder": "41.3.0",
    "@ckeditor/ckeditor5-alignment": "41.3.0",
    "@ckeditor/ckeditor5-autoformat": "41.3.0",
    "@ckeditor/ckeditor5-basic-styles": "41.3.0",
    "@ckeditor/ckeditor5-block-quote": "41.3.0",
    "@ckeditor/ckeditor5-code-block": "41.3.0",
    "@ckeditor/ckeditor5-dev-translations": "39.0.0",
    "@ckeditor/ckeditor5-editor-classic": "41.3.0",
    "@ckeditor/ckeditor5-essentials": "41.3.0",
    "@ckeditor/ckeditor5-font": "41.3.0",
    "@ckeditor/ckeditor5-heading": "41.3.0",
    "@ckeditor/ckeditor5-html-support": "41.3.0",
    "@ckeditor/ckeditor5-image": "41.3.0",
    "@ckeditor/ckeditor5-indent": "41.3.0",
    "@ckeditor/ckeditor5-link": "41.3.0",
    "@ckeditor/ckeditor5-list": "41.3.0",
    "@ckeditor/ckeditor5-markdown-gfm": "41.3.0",
    "@ckeditor/ckeditor5-mention": "41.3.0",
    "@ckeditor/ckeditor5-page-break": "41.3.0",
    "@ckeditor/ckeditor5-pagination": "41.3.0",
    "@ckeditor/ckeditor5-paragraph": "41.3.0",
    "@ckeditor/ckeditor5-source-editing": "41.3.0",
    "@ckeditor/ckeditor5-table": "41.3.0",
    "@ckeditor/ckeditor5-theme-lark": "41.3.0",
    "@ckeditor/ckeditor5-typing": "41.3.0",
    "@ckeditor/ckeditor5-upload": "41.3.0",
    "@ckeditor/ckeditor5-watchdog": "41.3.0",

vite config:

export default defineConfig({
  plugins: [
    vue(),
    istanbul({
      include: "app/frontend/src/*",
      exclude: ["node_modules", "test/"],
      extension: [".js", ".ts", ".vue"],
      requireEnv: true,
    }),
    ckeditor5({ theme: require.resolve("@ckeditor/ckeditor5-theme-lark") }),
    // ... ///
  test: {
    server: {
      deps: {
        inline: [/@ckeditor\/ckeditr5\/.*/i, /ckeditor5\/.*/i],
      },
    },
  },
});

Originally posted by @mahovsson in https://github.com/ckeditor/ckeditor5/issues/ #16075#issuecomment-2048460337

Witoso commented 6 months ago

I don't see you using required plugin for Vite (now in alpha)

npm install --save @ckeditor/vite-plugin-ckeditor5
export default defineConfig( {
    /* ... */
    plugins: [
        ckeditor5( { theme: require.resolve( '@ckeditor/ckeditor5-theme-lark' ) } )
    ]
    /* ... */
}

Pointing to the #15502 which will make this mature enough to not use the current version of a plugin.

mahovsson commented 6 months ago

I don't see you using required plugin for Vite (now in alpha)

npm install --save @ckeditor/vite-plugin-ckeditor5
export default defineConfig( {
  /* ... */
    plugins: [
        ckeditor5( { theme: require.resolve( '@ckeditor/ckeditor5-theme-lark' ) } )
    ]
      /* ... */
}

Pointing to the #15502 which will make this mature enough to not use the current version of a plugin.

Sorry I added my vite config file which looks same as your proposition. @Witoso is there anything else I could do besides skipping failing tests ?

EDIT: 22.4

So I added inline: [/@ckeditor\/.*/i, /ckeditor5\/.*/i], to vitest config instead and the test are passing, but I get:

Screenshot 2024-04-22 at 07 00 01