fastify-cookie icon indicating copy to clipboard operation
fastify-cookie copied to clipboard

Type Augmentation does not work in pnpm workspace monorepo

Open onlywei opened this issue 1 month ago • 2 comments

Prerequisites

  • [x] I have written a descriptive issue title
  • [x] I have searched existing issues to ensure the bug has not already been reported

Fastify version

5.6.2

Plugin version

11.0.2

Node.js version

24.11.1

Operating system

macOS

Operating system version (i.e. 20.04, 11.3, 10)

15.5

Description

Using this plugin within a pnpm workspace monorepo does not properly augment the types on fastify's Request object.

In a standalone single package repo, it works fine, but as soon as workspaces is introduced, it fails.

Please look at the README in the linked repo to see the error.

Link to code that reproduces the bug

https://github.com/onlywei/repro-fastify-plugins-esm-ts

Expected Behavior

No type errors

onlywei avatar Nov 26 '25 14:11 onlywei

I don't know pnpm, but if you find a fix and can push a PR I'll take a look.

jean-michelet avatar Nov 30 '25 18:11 jean-michelet

I don't know pnpm, but if you find a fix and can push a PR I'll take a look.

Hmm, it might not be fixable. The only thing I've found to work is to not disable hoisting for fastify plugin packages.

onlywei avatar Dec 05 '25 19:12 onlywei