-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error when try to use your component in Nextjs: Cannot find module 'tsup-tutorial/Button' or its corresponding type declarations. #2
Comments
You are not importing the package correctly. The correct ways. tsup-tutorial/Button |
Nope. If you try to use I think next 13.2 or younger it won’t work because they have moduleResolution:node instead of bundled
Sent from [Proton Mail](https://proton.me/mail/home) for iOS
…On Thu, Sep 21, 2023 at 9:50 PM, Rajdeep singh ***@***.***(mailto:On Thu, Sep 21, 2023 at 9:50 PM, Rajdeep singh <<a href=)> wrote:
You are not importing the package correctly. The correct ways.
tsup
-
tutorial
/
Button
—
Reply to this email directly, [view it on GitHub](#2 (comment)), or [unsubscribe](https://github.com/notifications/unsubscribe-auth/AH3JIERTJGYCXJ574M6IU73X3UKJTANCNFSM6AAAAAA5CA5OPQ).
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Yes, I've also found the same issue. Due to my busy schedule, I can not find the actual cause of the problem and also can't find a solution. |
@Jared-Dahlke I'm having the same error. What was the fix for this? |
I found a solution. for some reason you have to specify the exact path in package.json. So you have to have 2 exports per component. One for node and one for bundler And you have to import it from "/dist/button" But again if you can just get your consumers to change to bundler in their config then you don't have to do any of this it just works |
i am trying to use the button component in your library.
it works fine with Vite, but with Nextjs I cannot build because i get this error:
Cannot find module 'tsup-tutorial2/Button' or its corresponding type declarations.
Any idea why this may be?
The text was updated successfully, but these errors were encountered: