Type of Editor.ui
not resolvable with Yarn (strict) PnP mode
#17213
Labels
status:in-progress
Set automatically when an issue lands in the "In progress" column. We are working on it.
type:bug
This issue reports a buggy (incorrect) behavior.
📝 Provide detailed reproduction steps (if any)
tsc
to check types✔️ Expected result
The type of
this.editor.ui
to be resolved correctly, so that consequently the type oflocale
in thecomponentFactory.add
call can be inferred.❌ Actual result
The type of
this.editor.ui.componentFactory
is marked asany
yielding an errorParameter 'locale' implicitly has an 'any' type.ts(7006)
.❓ Possible solution
This issue only appears with Yarn PnP mode, as the import
import type { EditorUI } from '@ckeditor/ckeditor5-ui';
within theckeditor5-core
cannot be resolved, since the package is not listed as dependency inckeditor5-core
. To make this resolvable, the@ckeditor/ckeditor5-ui
should be listed as dependency, peerDependency or optional peerDependency in theckeditor5-core
, with the last one probably being the best option.Manual workarounds:
EditorUI
and manually cast with(this.editor.ui as EditorUI)
pnpMode: loose
or non-pnp mode with Yarn.yarnrc.yml
:📃 Other details
If you'd like to see this fixed sooner, add a 👍 reaction to this post.
The text was updated successfully, but these errors were encountered: