honojs / node-server

Node.js Server for Hono
https://hono.dev
370 stars 44 forks source link

`hono` is not declared as peer dependency #191

Closed marvinruder closed 1 month ago

marvinruder commented 1 month ago

Given a Hono project under Node.js using the Yarn package manager with Yarn PnP enabled, when attempting to import @hono/node-server, then the import fails with the message

  The Yarn Plug'n'Play manifest forbids importing "hono" here because it's not listed as a
  dependency of this package:

This is because @hono/node-server uses imports from hono (e.g. here) without declaring it as either a dependency or a peer dependency.

A possible workaround at the moment is to set

packageExtensions: 
  "@hono/node-server@*": 
    peerDependencies: 
      "hono": "*"

in your .yarnrc.yml