-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Missing "./ckeditor5.css" export in "ckeditor5" package #16638
Comments
Hi @nahabi, Are you using the latest versions of |
Please find my dependencies below:
And below is the code for the component:
|
Hey, this looks like some problem with a bundler, in a minimal sample it works correctly: https://stackblitz.com/edit/vitejs-vite-kxuglq?file=src%2Fmain.jsx Please compare to check if you are not missing something in the setup. |
I have the same issue in nextjs app. Please fix soon. |
@bokute2010 could you please provide some minimal reproducible sample and version details, we tested the Next.js app setup multiple times with new installation methods, and this was not appearing. |
@Witoso |
Could you please provide some minimal reproducible sample? |
I face this problem with vite v2.9.18
Currently, I use relative path to solve this problem. // Missing "./ckeditor5.css" export in "ckeditor5" package error during build
import 'ckeditor5/ckeditor5.css';
// Pass
import './../../../node_modules/ckeditor5/dist/ckeditor5.css'; In IDE hint, I found wildcard don't work in vite. there is a issue related to this problem. "exports": {
"...": "..."
"./ckeditor5.css": "./dist/ckeditor5.css", // add this line can fix the issue
"./*.css": "./dist/*.css", // but why this line won't wok?
"...": "..."
}, |
As you mentioned, works in Vite from version v4: https://stackblitz.com/edit/gnj9y8?file=index.html,package.json @filipsobol wdyt about adding additional explicit export, not sure if this is a proper convention. |
After update the vite major version, everything works well. Thanks! |
TLDR: The current implementation of wildcards in the I have tested the current implementation with Vite in versions 2 (❌), 3 (❌), and 4 (✅). At first, the problem seemed to be related to paths containing the {
".": {
"types": "./dist/types/index.d.ts",
"import": "./dist/ckeditor5.js"
},
// ⬇️⬇️⬇️
"./translations/*.js": {
"types": "./dist/translations/*.d.ts",
"import": "./dist/translations/*.js"
},
"./*.css": "./dist/*.css",
"./build/*": "./build/*",
"./src/*": "./src/*",
// ⬆️⬆️⬆️
"./package.json": "./package.json"
} However, in Vite 2 and 3, I was able to load files from the This needs more testing, but if this is the case, then changing the {
".": {
"types": "./dist/types/index.d.ts",
"import": "./dist/ckeditor5.js"
},
// ⬇️⬇️⬇️
"./*": "./dist/*",
"./browser/*": null,
// ⬆️⬆️⬆️
"./build/*": "./build/*",
"./src/*": "./src/*",
"./package.json": "./package.json"
} However, if this doesn't work, then we may need to require Vite 4+, because updating the What about webpack 4 and 5? Wildcard support in the Because of this issue, I was worried about webpack 4, which we still support in legacy installation methods. Since |
Fix (ckeditor5): Update the `exports` field in `package.json` to fix issues with loading CSS and translations in older bundlers. See #16638. Internal: Remove the "Lint generated packages" step from CI due to a limitation of the validation library.
Fix (generator): Update the `exports` field in `package.json` templates to fix issues with loading CSS and translations in older bundlers. See ckeditor/ckeditor5#16638.
This problem has been fixed in |
Reproduction steps
Current behavior
Returns [plugin:vite:import-analysis] Missing "./ckeditor5.css" export in "ckeditor5" package
Expected behavior
For the app to run
Definition of Done
Relevant debug data
Other details
No response
User agent
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36
The text was updated successfully, but these errors were encountered: