Need to add /src after the import statement to be able to use type definitions #507
Unanswered
RubenPauwelsUniWeb
asked this question in
Q&A
Replies: 2 comments 1 reply
-
Adding |
Beta Was this translation helpful? Give feedback.
0 replies
-
As you can see they are there. For some reason they are in |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
We are using a generated tarball, using the default config.
Our build command looks like this:
yarn prepack && npm pack
When we try to import the package in our project (after adding it with
yarn add
) we need to specify the import statement like this:import {useCustomHook} from 'our-package/src';
If we don't add
/src
to the import we get this TS error:Cannot find module 'our-package' or its corresponding type declarations.ts(2307)
Is it possible to omit the
/src
and still be able to use the type definitions?Beta Was this translation helpful? Give feedback.
All reactions