Skip to content
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

@ckeditor/ckeditor5-watchdog latest update issue #356

Closed
Nightcro opened this issue Mar 2, 2023 · 7 comments
Closed

@ckeditor/ckeditor5-watchdog latest update issue #356

Nightcro opened this issue Mar 2, 2023 · 7 comments
Labels
resolution:resolved This issue was already resolved (e.g. by another ticket). squad:devops Issue to be handled by the Devops team. type:bug

Comments

@Nightcro
Copy link

Nightcro commented Mar 2, 2023

Hello, after updating to latest version, I get this error. I do not have @ckeditor/ckeditor5-watchdog in my package.json.

Error: node_modules/@ckeditor/ckeditor5-angular/ckeditor.component.d.ts:7:28 - error TS7016: Could not find a declaration file for module '@ckeditor/ckeditor5-watchdog/src/watchdog'. /node_modules/@ckeditor/ckeditor5-angular/node_modules/@ckeditor/ckeditor5-watchdog/src/watchdog.js' implicitly has an 'any' type.
Try npm i --save-dev @types/ckeditor__ckeditor5-watchdog if it exists or add a new declaration (.d.ts) file containing declare module '@ckeditor/ckeditor5-watchdog/src/watchdog';

7 import WatchdogConfig from '@ckeditor/ckeditor5-watchdog/src/watchdog';

@Nightcro
Copy link
Author

Nightcro commented Mar 2, 2023

I managed to fix it by adding this:

declare module '@ckeditor/ckeditor5-watchdog/src/watchdog' {
	const WatchdogConfig: any;
	type WatchdogConfig = any;
	
        export default WatchdogConfig;
}

@pomek pomek added type:bug squad:devops Issue to be handled by the Devops team. labels Mar 3, 2023
@mabryl
Copy link

mabryl commented Mar 3, 2023

Hi @Nightcro,

Thanks for reaching out. Looks like the issue is reproducible, so thank you for bringing it to our attention.

Precise steps on how to reproduce with a fresh Angular app:

  1. Create a new Angular project: ng new angular-ckeditor
  2. Install the CKEditor Angular component: npm install --save @ckeditor/ckeditor5-angular
  3. Install the CKE build of your choice, e.g. Classic: npm install --save @ckeditor/ckeditor5-build-classic
  4. Create the typings.d.ts file in accordance with our docs
  5. Try to build the app: ng build
  6. This error appears:
Error: node_modules/@ckeditor/ckeditor5-angular/ckeditor.component.d.ts:7:28 - error TS7016: Could not find a declaration file for module '@ckeditor/ckeditor5-watchdog/src/watchdog'. '[...]/node_modules/@ckeditor/ckeditor5-watchdog/src/watchdog.js' implicitly has an 'any' type.
  Try `npm i --save-dev @types/ckeditor__ckeditor5-watchdog` if it exists or add a new declaration (.d.ts) file containing `declare module '@ckeditor/ckeditor5-watchdog/src/watchdog';`

7 import WatchdogConfig from '@ckeditor/ckeditor5-watchdog/src/watchdog';

Running npm i --save-dev @types/ckeditor__ckeditor5-watchdog, as suggested by the error message fixes the issue and lets you build the app.

@pomek let me know if you want me to retest this.

@pomek
Copy link
Member

pomek commented Mar 3, 2023

Ok, so as long as CKEditor 5 Angular component uses the Watchdog feature from the JS version of the code, we must include typings as a dependency too.

Thanks @mabryl, for confirming the issue. We will let you know once we release the solution. I hope it will next week.

@g-gibosky
Copy link

I managed to fix it by adding this:

declare module '@ckeditor/ckeditor5-watchdog/src/watchdog' {
	const WatchdogConfig: any;
	type WatchdogConfig = any;
	
        export default WatchdogConfig;
}

Fixed for me. Thanks!

@rbalet
Copy link

rbalet commented Apr 7, 2023

@Nightcro I do get the following error while trying your fix.

annot redeclare exported variable 'default'.ts(2323)
type WatchdogConfig = any
const WatchdogConfig: any

Where did you have added this piece of code ?

@Nightcro
Copy link
Author

Nightcro commented Apr 7, 2023

This was fixed with the latest release of ckeditor, you do not need these typings anymore.
Follow the update guide from ckeditor for latest release

https://ckeditor.com/docs/ckeditor5/latest/updating/guides/update-to-37.html

I will close this issue

@Nightcro Nightcro closed this as completed Apr 7, 2023
@rbalet
Copy link

rbalet commented Apr 7, 2023

Thx @Nightcro, I still have the error though, I did a add a pull request that helped me solve the problem

@pomek pomek added the resolution:resolved This issue was already resolved (e.g. by another ticket). label Apr 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
resolution:resolved This issue was already resolved (e.g. by another ticket). squad:devops Issue to be handled by the Devops team. type:bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants