[CKEditor 5] MathType Plugin leads to 'Uncaught CKEditorError: ckeditor-duplicated-modules'
type:bug
## Description
The bug originates when trying to to incorporate MathType, according to the documentation, into a CKEditor5 Instance. Related to this [issue](https://github.com/wiris/html-integrations/issues/1041).
<img width="693" alt="Image" src="https://github.com/user-attachments/assets/d802014e-5101-4270-8a8f-a6ba9281601b" />
## Environment
### MathType
- `"@wiris/mathtype-ckeditor5": "^8.12.0"`
### Other dependencies
- `"@ckeditor/ckeditor5-react": "^9.5.0",`
- `"ckeditor5": "^43.3.1",`
- `"react": "^18.3.1",`
- `"react-dom": "^18.3.1"`
- `"typescript": "^5.8.2",`
- `"vite": "^6.2.0",`
### Environment
- local
- Macbook (M4 ARM)
- production
- Azure Frontdoor CDN bundle
### Plugins
```tsx
import { Bold, Essentials, Italic, Paragraph } from 'ckeditor5'
import MathType from '@wiris/mathtype-ckeditor5/src/plugin.js'
// ...
plugins: [Essentials, Paragraph, Bold, Italic, MathType],
```
## Steps to reproduce
This public repository [react-mathtype-demo](https://github.com/brainboost-eu/react-mathtype-demo) holds an example of our stack.
- Clone the repository
- `pnpm install`
- `pnpm dev`
> N.B. The injection of the plugin is commented with a `FIXME` in [src/components/editor.tsx](https://github.com/brainboost-eu/react-mathtype-demo/blob/main/src/components/editor.tsx)
## Expected result
Adding MathType to the plugin list should not break CKEditor. The expected result can be shown by commenting line # 18 in [src/components/editor.tsx](https://github.com/brainboost-eu/react-mathtype-demo/blob/main/src/components/editor.tsx)
<img width="906" alt="Image" src="https://github.com/user-attachments/assets/7c9ed64c-5e62-4639-ad80-2015435cc637" />
## Actual result
The editor crashes, leading to a blank screen. The console shows
<img width="693" alt="Image" src="https://github.com/user-attachments/assets/d802014e-5101-4270-8a8f-a6ba9281601b" />
## Other details
We are using the vite bundler and typescript, and according to the documentation, are importing `import MathType from '@wiris/mathtype-ckeditor5/src/plugin.js'`
关闭于 2025-04-02 6 条评论