CI error when importing static image files
I noticed a strange issue with my CI today. In one of the files, I am importing a jpg to later use it in the
Image
component from Next.
Normally in your editor, this is all fine, no type errors. In CI however, Typescript can't find the module/its type declarations.
I found that the image declarations are imported in the next-env.d.ts
file. Because it is not committed to VC and my CI simply runs tsc -noEmit
when typechecking, there is no way for Typescript to find the type declarations.
With that all said, what do you think I should do? The next-env.d.ts
is usually not committed, but doing so would fix the problem. Another option would be to (somehow?) run next to generate the file in CI. The third option would be to declare the image types myself in another .d.ts
file.
I'd be interested to hear other opinions on this!0 Replies