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
Use next/image in component library, but throws error in dev mode #26674
Comments
i had the same error on mac os, creating an
|
Having this issue too. Any solutions? |
Have you tried adding a I guess the problem also can be that the component is trying to find the |
First of all, thanks for merging my recent pull request recently! (#33290) |
Seems that something is happening with my library setup, so probably there is no real issue. I'll try figure it out |
Hi, this has been fixed in #33559 It is available starting with |
Hello, I forgot to mention that I had solved it, the problem was with my library's bundler configuration since my next app throwed errors about next/router and others as well. I finally managed to get rid of these problems by using next transpile modules package which works its magic with babel configuration and makes a simple react library like mine working with next js. I would be grateful to hear your opinion about this package. Is it a trustworthy solution or maybe I need to look further down on my library's setup? I am currently using rollup as my library's bundler. |
You should be able to get away without using One example I immediately found was https://github.com/vercel/turborepo/tree/main/examples/design-system where you can develop your library next to a next.js app for maximum efficiency. You can use any tools you like, but for a shared lib combined with a framework, workspaces are pretty common tools nowadays. |
This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
What version of Next.js are you using?
11.0.1
What version of Node.js are you using?
14.16.1
What browser are you using?
Brave, Chrome,
What operating system are you using?
macOS
How are you deploying your application?
Vercel
Describe the Bug
We created our own components library and published it to the GitLab package registry.
Our Product Cover component is based on
next/image
. It works fine on a storybook withunoptimized
props.But I can't use
<Cover/>
component on the NextJS application because of an error.Here is my component source:
In my application, I installed a component library, use it in ProductList component.
Here is
next.config.js
:Expected Behavior
TDB
To Reproduce
TDB
The text was updated successfully, but these errors were encountered: