You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When trying to compile unplugin we get a type is not portable error on multiple plugins.
Additional context
This error happens when trying to compile a .d.ts file. Some inferred type within unplugin is private, making it impossible for the .d.ts file to reference it. Because of this this error gets thrown.
As a workaround I cast the vite plugin as a rollup plugin and the webpack plugin as a rsPack plugin.
To fix just need to explicitly type whatever types from vite and webpack are being inferred privately or reexport them.
Logs
src/unplugin/index.ts:55:14 - error TS2742: The inferred type of 'viteFoundry' 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.
55 export const viteFoundry = foundryUnplugin.vite
~~~~~~~~~~~
src/unplugin/index.ts:58:14 - error TS2742: The inferred type of 'webpackFoundry' cannot be named without a reference to '.pnpm/[email protected]/node_modules/webpack'. This is likely not portable. A type annotation is necessary.
58 export const webpackFoundry =
The text was updated successfully, but these errors were encountered:
Environment
Reproduction
https://github.com/evmts/evmts-monorepo/blob/main/bundlers/bundler/src/unplugin/index.ts
pnpm install
cd bundlers/bundler
npx tsc --emitDeclarationOnly
Describe the bug
When trying to compile unplugin we get a
type is not portable
error on multiple plugins.Additional context
This error happens when trying to compile a
.d.ts
file. Some inferred type within unplugin is private, making it impossible for the.d.ts
file to reference it. Because of this this error gets thrown.As a workaround I cast the
vite
plugin as arollup
plugin and thewebpack
plugin as arsPack
plugin.To fix just need to explicitly type whatever types from vite and webpack are being inferred privately or reexport them.
Logs
The text was updated successfully, but these errors were encountered: