Skip to content

Missing peer dependency on fastify #159

@jscheid

Description

@jscheid

🐛 Bug Report

This package imports fastify but doesn't declare a dependency on it (except for a devDependency.) This breaks eg. with yarn pnp:

../.yarn/cache/fastify-static-npm-3.3.0-0772a5855d-9fda689884.zip/node_modules/fastify-static/index.d.ts:5:60 - error TS2307: Cannot find module 'fastify' or its corresponding type declarations.

5 import { FastifyPlugin, FastifyReply, RawServerBase } from 'fastify'

As a workaround, this can be added to .yarnrc.yml:

packageExtensions:
  fastify-static@*:
    peerDependencies:
      fastify: "*"

To Reproduce

Try using this package with a pnp-enabled yarn package.

Expected behavior

-/-

Your Environment

  • node version: 14.14.0
  • fastify version: 3.7.0
  • os: Mac
  • Yarn version 2.3.3-git.20201103.34883f8

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions