Wiris MathType plugin is not working with ckeditor5 in Angular 18
Reproduction steps
- …Angular 18.2.9 has CKeditor5 integration that is working well but when npm i @wiris/mathtype-ckeditor5
// import MathType from '@wiris/mathtype-ckeditor5'; // import MathType from '@wiris/mathtype-ckeditor5/dist/index.js'; // import MathType from '@wiris/mathtype-ckeditor5/dist/index'; // Suppress the error by using require: const MathType = require('@wiris/mathtype-ckeditor5/dist/index.js');
// Editor configuration public editorConfig = { plugins: [MathType], // Add MathType plugin here toolbar: [ 'heading', // Heading styles '|', 'bold', 'italic', 'underline', // Text formatting '|', 'link', // Hyperlink 'bulletedList', 'numberedList', // Lists '|', 'MathType', 'ChemType', // Add MathType and ChemType buttons '|', 'undo', 'redo' // Undo and redo ] };
then multiple errors are showing. svg related and multiple others. Can you suggest how to fix this? 2. … 3. …
Current behavior
multiple issue generate if using npm i @wiris/mathtype-ckeditor5 svg and others pulgin suggest install then full project and code-based fail also ng server not working .
Expected behavior
npm i @wiris/mathtype-ckeditor5 If Downlaod, then, as suggested by the doc code, add then need to work.
import { Component } from '@angular/core'; import * as ClassicEditor from '@ckeditor/ckeditor5-build-classic'; import MathType from '@wiris/mathtype-ckeditor5';
@Component({ selector: 'app-root', templateUrl: './app.component.html', styleUrls: ['./app.component.scss'] }) export class AppComponent { public Editor = ClassicEditor;
constructor() { ClassicEditor.builtinPlugins.push(MathType); // Add MathType plugin to the CKEditor build }
public editorConfig = { toolbar: ['mathType', 'chemType', '|', 'bold', 'italic', 'undo', 'redo'] }; }
<ckeditor [editor]="Editor" [config]="editorConfig" data="
Start typing and use MathType!
"Definition of Done
import MathType from '@wiris/mathtype-ckeditor5'; this is not working as [email protected] start
ng serve
Workspace extension with invalid name (defaultProject) found.
Would you like to share pseudonymous usage data about this project with the Angular Team at Google under Google's Privacy Policy at https://policies.google.com/privacy. For more details and how to change this setting, see https://angular.dev/cli/analytics.
yes
Thank you for sharing pseudonymous usage data. Should you change your mind, the following command will disable this feature entirely:
ng analytics disable
Global setting: enabled Local setting: enabled Effective status: enabled Error: Schema validation failed with the following errors: Data path "" must have required property 'buildTarget'. /opt/lampp/htdocs/angular18/test-project/node_modules/rxjs/dist/cjs/internal/util/reportUnhandledError.js:13 throw err; ^
SchemaValidationException [Error]: Schema validation failed with the following errors: Data path "" must have required property 'buildTarget'. at /opt/lampp/htdocs/angular18/test-project/node_modules/@angular/cli/node_modules/@angular-devkit/architect/src/architect.js:38:27 { errors: [ { instancePath: '', schemaPath: '#/required', keyword: 'required', params: { missingProperty: 'buildTarget' }, message: "must have required property 'buildTarget'" } ] }
Relevant debug data
Other details
No response
User agent
Amarbhanu
There has been no activity on this issue for the past year. We've marked it as stale and will close it in 30 days. We understand it may still be relevant, so if you're interested in the solution, leave a comment or reaction under this issue.