admin管理员组文章数量:1390503
Need help understanding why next.js can't resolve my static image.
I have a monorepo next.js structure so I can share components between projects, and this is my folder structure.
.
├── apps
│ └── web
│ ├── components
│ ├── node_modules
│ ├── pages
│ └── styles
├── node_modules
└── packages
├── eslint-config
└── typescript-config
I have tried to put my public
folder in the root of the entire repo, and in the apps/web/
folder. I have tried to reference the image via /public/<file_path>.png
and without it -> /<file_path>.png
<Image src={`/static/haroombe_logo.png`} alt='logo' width="64" height="64" />
In both cases it throws a variation of the following error.
The requested resource isn't a valid image for / received text/html; charset=utf-8
The image is less than 200 KB so I am wondering if it is a config or alias issue I didn't set up.
Edit~: I fot to mention I am using the Shadcn ui monorepo for next js
EDIT/Workaround: I manually imported the image then set it in the src tag.
本文标签: javascriptThe requested resource isn39t a valid image NextJS monorepoStack Overflow
版权声明:本文标题:javascript - The requested resource isn't a valid image Next.JS monorepo - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744580731a2613903.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论