unjs / unplugin

Unified plugin system for Vite, Rollup, Webpack, esbuild, Rolldown, and more
https://unplugin.unjs.io
MIT License
3.02k stars 109 forks source link

Error occurred in dts build in monorepo #356

Closed slavamak closed 5 months ago

slavamak commented 10 months ago

Environment

node 18.15.0 unplugin 1.6.0 pnpm 8.14.0

Reproduction

https://github.com/slavamak/unplugin-monorepo-issue

Describe the bug

  1. git clone https://github.com/slavamak/unplugin-monorepo-issue.git
  2. pnpm i
  3. 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/vite@5.0.6_@types+node@20.10.3/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/vite@5.0.6_@types+node@20.10.3/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/webpack@5.89.0_esbuild@0.19.8/node_modules/webpack'. This is likely not portable. A type annotation is necessary.
slavamak commented 9 months ago

I see that this #351 is closed. Is there any reason why it can't be merged?

slavamak commented 9 months ago

I bump unplugin and vite to latest version, but this doesn't fix this issue. Doesn't anyone else face this issue?

289420843 commented 8 months ago

me too

slavamak commented 8 months ago

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.

289420843 commented 8 months ago

I'm trying to learn how the library is build. https://github.com/vue-macros/vue-macros

slavamak commented 5 months ago

I have updated the package versions and also use pnpm v9 and it works. I don't know what was the cause