Error occurred in dts build in monorepo
Environment
node 18.15.0 unplugin 1.6.0 pnpm 8.14.0
Reproduction
https://github.com/slavamak/unplugin-monorepo-issue
Describe the bug
-
git clone https://github.com/slavamak/unplugin-monorepo-issue.git -
pnpm i -
pnpm build
Additional context
Upgrading the vite package to version 5 in unplugin solves this problem.
Logs
src/vite.ts(4,1): error TS2742: The inferred type of 'default' cannot be named without a reference to '.pnpm/[email protected]_@[email protected]/node_modules/vite'. This is likely not portable. A type annotation is necessary.
src/vite.ts(4,1): error TS2742: The inferred type of 'default' cannot be named without a reference to '.pnpm/[email protected]_@[email protected]/node_modules/vite'. This is likely not portable. A type annotation is necessary.
src/webpack.ts(4,1): error TS2742: The inferred type of 'default' cannot be named without a reference to '.pnpm/[email protected][email protected]/node_modules/webpack'. This is likely not portable. A type annotation is necessary.
I see that this #351 is closed. Is there any reason why it can't be merged?
I bump unplugin and vite to latest version, but this doesn't fix this issue. Doesn't anyone else face this issue?
me too
Maybe it is not a problem of unplugin and it is a problem of tsup but I have not seen any issues about it. At least understand what the problem is unfortunately I'm not very good at it to figure it out.
I'm trying to learn how the library is build. https://github.com/vue-macros/vue-macros
I have updated the package versions and also use pnpm v9 and it works. I don't know what was the cause