Open greggmoritz opened 4 days ago
Most of our packages have ckeditor5
as the only dependency, because it has all the other open-source packages in its dependencies
, which is correct. However, it seems that Yarn PnP requires all used dependencies to be defined directly in the package that uses them, rather than indirectly through the dependencies of a dependency.
I have created a few PRs to fix this, and will discuss this with the team, as it will require some changes to the internal tooling.
Out of curiosity: Why has it surfaced now? We didn't have those deps listed there for years now. Is it related to NIM or it was always a problem?
It's related to new installation methods (NIM). During the build process, some of the imports are rewritten to make code written for old installation methods work with NIM. For example:
// This import ...
import { Plugin } from 'ckeditor5/src/core.js';
// ^^^^^^^^^
// ... will be replaced with.
import { Plugin } from '@ckeditor/ckeditor5-core/dist/index.js';
// ^^^^^^^^^^^^^^^^^^^^^^^^
Before the changes, the only direct dependency of most packages was the ckeditor5
package. We didn't change this because ckeditor5
has all of our open-source packages as its dependencies anyway. However, as I described in my previous message, this is not enough for Yarn PnP.
📝 Provide detailed reproduction steps (if any)
CKEditor
component from@ckeditor/ckeditor5-react
)✔️ Expected result
Vite dev builds/runs successfully
❌ Actual result
Vite dev build failed with 168 instances of the same error, but with different instances. Below is an example of just one instance of the error in the CLI output
❓ Possible solution
I was able to resolve the build issue on my end by making use of Yarn's
packageExtensions
config option, which is meant as an escape hatch for "packages {that] may have been specified incorrectly with regard to their dependencies".I'm filing this issue because it's likely that there's some dependency misconfiguration that other package managers or installation strategies are less strict about.
For your reference (and for anyone else experiencing the same issue), here is the config that got rid of all of the build errors and the app running as expected:
📃 Other details
Development Environment:
Yarn 4.30 using Yarn Plug'n'Play (pnp)
Vite 5.3.0
React 18.3.1
Browser: Chrome (NA)
OS: macOs Sonoma 14.5
First affected CKEditor version: v42.0.0
Installed CKEditor plugins:
If you'd like to see this fixed sooner, add a 👍 reaction to this post.