Next Image can't be used in a Shared Component Library?
Unanswered
Grass carp posted this in #help-forum
Grass carpOP
- Next.js version:
- TurboRepo.
- Shared UI library being used in Next.js App.
Being used in shared component library:
Issue:
Being used in actual Next.js
No issues
The
Can Next.js
^13.4.12- TurboRepo.
- Shared UI library being used in Next.js App.
import Image from 'next/image';Being used in shared component library:
Issue:
Warning: React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: object.<Image alt={imageAlt} src={imageSrc} fill className='rounded-xl' />Being used in actual Next.js
page.tsxNo issues
<Image alt='1' src='/dark-mode.webp' fill className='rounded-xl' />The
imageSrc is just a reference to an image in the Next.js app public directory.Can Next.js
<Image />, not be used in components?