When I import a function from another package, it loses its type definition. The type is defined globally within that package. Other types work fine. How can I solve it?
It is necessary to say that I am just performing transition from yarn 1.22 to pnpm and this has worked with yarn just a commit prior. (see screenshot at the bottom)
pnpm-workspace.yaml
packages:
- apps/*
- packages/*
root package.json
"pnpm": {
"overrides": {
"holograph": "link:packages/holograph",
}
},
app-v2 tsconfig.json
"include": [
"next-env.d.ts",
"src/**/*.ts",
"src/**/*.tsx",
"../../packages/**/*.ts",
"../../packages/**/*.tsx",
"../../packages/next-config/next.global.d.ts",
],
Where apps/app-v2
(on left) imports from packages/holograph
(on right).
Furthermore, I noticed that declaring the type in an Ambient declarations file (interfaces.d.ts
) works, but it is not picked up when contributing ambient declarations via declare global
keyword.
After reverting the commit back and installing with yarn
, the type is working again.
Also in pnpm repo https://github.com/orgs/pnpm/discussions/8278