#Unknown file extension “.svg”
1 messages · Page 1 of 1 (latest)
Help is on the way! To mark it as solved, use the /solve command. In the meantime, here are some existing threads that may help you:
Documentation:
- Generating TypeScript Interfaces - Disable declare statement
- Context - TypeScript
- Uploads - Enabling Uploads - Payload-wide Upload Options
Community-Help:
@cloud orbit Do you import an svg somewhere?
Yes, I do.
@cloud orbit How do you import it?
@twin widget for example:
import PotatoGraduatedSVG from 'public/images/potatoes/graduated.svg'
import PotatoGraduatedNotSVG from 'public/images/potatoes/graduated_not.svg'
import { POTATO_NAMES } from './constants/potato-names'
import { POTATO_ALT } from '@/shared/helpers/get-potato/constants/potato-alt'
export { POTATO_NAMES }
export default function getPotato(potato: string) {
switch (potato) {
case POTATO_NAMES.GRADUATED: {
const { width, height, src } = PotatoGraduatedSVG
return { width, height, src, alt: POTATO_ALT[POTATO_NAMES.GRADUATED] }
}
case POTATO_NAMES.GRADUATED_NOT: {
const { width, height, src } = PotatoGraduatedNotSVG
return { width, height, src, alt: POTATO_ALT[POTATO_NAMES.GRADUATED_NOT] }
}
default: {
throw new Error('Invalid potato name')
}
}
}
@cloud orbit you can't import images directly in nextjs. https://dev.to/dolearning/importing-svgs-to-next-js-nna