Issue with "nested" types paths in the vite.config.ts
#11539
Unanswered
orangecoloured
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm using bpampuch/pdfmake to generate a pdf on build stage. Everything works well, but for the typings. Types for
pdfmake
have to be installed separately and the schema type can be imported frompdfmake/interfaces
.So, like this:
It fails on run. No matter,
dev
orbuild
. The error isI tried to manually export the type from the index file in types package and it works. So the issue here is that it tries to get the type using the wrong path. Instead of
@types/pdfmake/
it goes topdfmake/
. Weird issue. Usingvite
in other project I didn't face this.I solved this by doing this:
type TDocumentDefinitions = Parameters<pdfmake['createPdfKitDocument']>[0];
But can this be fixed by updating some config so it uses correct path?
Beta Was this translation helpful? Give feedback.
All reactions