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
A TS error existed when generating dts file in monorepo project.
[vite:dts] Start generate declaration files...
src/index.ts:1:22 - error TS6059: File '/home/projects/vitejs-vite-ceq4fy/packages/b/src/index.ts' is not under 'rootDir' '/home/projects/vitejs-vite-ceq4fy/packages/a'. 'rootDir' is expected to contain all source files.
1 import { b, B } from '@mine/b';
~~~~~~~~~
✓ built in 1.94s
[vite:dts] Declaration files built in 1809ms.
Have the same error. So, migrating from tsup to vite because of build error's (specifically this error in aws amplify: aws-amplify/amplify-js#9639). I am using turborepo
So, for me, asfaik it is because of my importing within the monorepo
folder structure:
rootStuff (package.json, etc.)
packages
somePackage (with package.json, vite config, etc.) - this package is to be a module published to npm
someOtherPackage (with package.json, vite config, etc.)
Basically, i in, say, somePackage/src/**/someFile i do import something from '../../../someOtherPackage/etc' and the error happens.
It builds fine, just fails at the typings, which was not problematic with tsup.
trying to figure out a workaround now, thought i'd just share this
Describe the bug
A TS error existed when generating dts file in monorepo project.
My
vite.config.ts
file in package@mine/a
:The error doesn't exist when
rootDir
is..
, but no dts file has been created.Reproduction
https://stackblitz.com/edit/vitejs-vite-ceq4fy?file=packages/a/package.json
Steps to reproduce
Run
pnpm --filter @mine/a run build
System Info
Validations
The text was updated successfully, but these errors were encountered: