Yarn PnP, following a pre-assembled dependency map, tries to find posthtml;
Yarn sees that posthtml is among the downloaded ones, but looking at the package.json of a plugin doesn't see that it depends on posthtml.
Yarn thinks that such an import is not safe and interrupts the launch, displaying an error in the console.
A solution was found both on the part of the user and on the part of the developer.
Discovered solutions
From the `user's` side:
Using an `.yarnrc.yml` file enter the code below there, then rebuild the dependency map with the `yarn` command.
```yml
# Manually prescribe dependencies for the plugin.
packageExtensions:
posthtml-expressions@*:
dependencies:
posthtml: '*'
```
From the `developers'` side:
Make the dependency on `posthtml` explicit by moving the line indicating its dependency to the _dependencies_ section.
```json
From
"devDependencies": {
"posthtml": "lasted"
}
To
"dependencies": {
"posthtml": "lasted"
}
```
Soon I will try to make a PR, where I will move the dependency line from posthtml to the dependencies section.
This will solve the problem, according to the experience of another project.
Hello!
In the process of using the
yarn
package manager technology, calledplug'n'play
, i encountered an error when trying to launch.A similar error has already happened with another library, and, apparently, it happens because of this:
posthtml
;posthtml
is among the downloaded ones, but looking at thepackage.json
of a plugin doesn't see that it depends onposthtml
.A solution was found both on the part of the user and on the part of the developer.
Discovered solutions
From the `user's` side: Using an `.yarnrc.yml` file enter the code below there, then rebuild the dependency map with the `yarn` command. ```yml # Manually prescribe dependencies for the plugin. packageExtensions: posthtml-expressions@*: dependencies: posthtml: '*' ``` From the `developers'` side: Make the dependency on `posthtml` explicit by moving the line indicating its dependency to the _dependencies_ section. ```json From "devDependencies": { "posthtml": "lasted" } To "dependencies": { "posthtml": "lasted" } ```Soon I will try to make a PR, where I will move the dependency line from
posthtml
to the dependencies section. This will solve the problem, according to the experience of another project.