-
Notifications
You must be signed in to change notification settings - Fork 99
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
I want to integrate CKEditor5 in react app with comments feature ejecting the configuration is not an option tried using create-react-app@1 but it's showing the same error. #63
Comments
Please, create a proper issue that describes what you want to achieve, what did you do in order to get it and what kind of errors are thrown. You can use the Issue template as a pattern if you don't have an idea of how to describe it. A few days ago we resolved an issue related to Comments feature. You can read more about in #62. PS: The title of the issue is not the best place for describing the entire problem. |
Can you please the check the issue I have modified the description |
It looks like Webpack cannot load CSS file. We are aware of this problem. See this comment – #62 (comment) – I described a solution that should help. |
I tried it do I need to add any other variable styles because it throws err: styles is not defined |
Follow the instruction – https://ckeditor.com/docs/ckeditor5/latest/builds/guides/integration/frameworks/react.html#changes-required-in-webpacks-production-configuration – step by step. After all, see this comment – #62 (comment). |
I did the same as mentioned I got this error ./node_modules/@ckeditor/ckeditor5-collaboration-core/src/users/usercolors.css (./node_modules/css-loader!./node_modules/postcss-loader/src!./node_modules/@ckeditor/ckeditor5-collaboration-core/src/users/usercolors.css) |
Could you share the configuration that produces the error? |
This comment has been minimized.
This comment has been minimized.
AFAICS: { test: /(\.css$)/, loaders: ['style-loader', 'css-loader', 'postcss-loader'] }, catches our styles, so you need to disable it for CKEditor 5 assets: {
test: /(\.css$)/,
exclude: [
/ckeditor5-[^/\\]+[/\\]theme[/\\].+\.css/,
/ckeditor5-[^/\\]+[/\\]src[/\\].+\.css/
],
loaders: ['style-loader', 'css-loader', 'postcss-loader']
}, Next: {
test: /\.css$/,
exclude: /ckeditor5-[^/\\]+[/\\]theme[/\\].+\.css/,
// (...)
} It does nothing. You must remove it. Next: // Adds support for CSS Modules (https://github.com/css-modules/css-modules)
// using the extension .module.css
{
test: cssModuleRegex,
use: getStyleLoaders({
importLoaders: 1,
sourceMap: isEnvProduction
? shouldUseSourceMap
: isEnvDevelopment,
modules: true,
getLocalIdent: getCSSModuleLocalIdent,
}),
},
// Opt-in support for SASS (using .scss or .sass extensions).
// By default we support SASS Modules with the
// extensions .module.scss or .module.sass
{
test: sassRegex,
exclude: sassModuleRegex,
use: getStyleLoaders(
{
importLoaders: 2,
sourceMap: isEnvProduction
? shouldUseSourceMap
: isEnvDevelopment,
},
'sass-loader'
),
// Don't consider CSS imports dead code even if the
// containing package claims to have no side effects.
// Remove this when webpack adds a warning or an error for this.
// See https://github.com/webpack/webpack/issues/6571
sideEffects: true,
},
// Adds support for CSS Modules, but using SASS
// using the extension .module.scss or .module.sass
{
test: sassModuleRegex,
use: getStyleLoaders(
{
importLoaders: 2,
sourceMap: isEnvProduction
? shouldUseSourceMap
: isEnvDevelopment,
modules: true,
getLocalIdent: getCSSModuleLocalIdent,
},
'sass-loader'
),
}, Are you sure that you need three another CSS loaders? If so, you must disable CKEditor 5 assets as we did at the beginning of this comment. If it still does not work, I can't help you because I don't know what to do more. We checked our documentation a few times and it worked for us perfectly. Be sure that you follow the documentation step by step. |
Thanks, @pomek It worked |
HI @pomek I was going through your custom build documentation and I can't add extra plugins. |
If you want to use CKEditor 5 Framework inside the react application, you can't avoid ejecting. But you can create a custom build in a separate repository and add it as a dependency to the react app. This way you can skip ejecting because the build will be ready-to-use. |
So you mean creating a custom build by ejecting the configuration and add it as dependency to the parent react app |
I meant creating a custom build – https://ckeditor.com/docs/ckeditor5/latest/builds/guides/development/custom-builds.html. You can fork a current build, modify to match your requirements, rebuild the package and publish (on GH or even npm). Then, inside your react app you can add the build as a dependency. In your component, you can just import it and you don't have to think about ejecting the webpack configurations. |
error:
Module not found: Can't resolve './@ckeditor/ckeditor5-collaboration-core/src/users/users.css' in '/Users/varun.meka/test/node_modules/@ckeditor/ckeditor5-comments/src/sidebar' and i have not ejected any configuration
The text was updated successfully, but these errors were encountered: