NuxtN
Nuxt15mo ago
MIDI

Importing images shows error in vscode, works in build

Importing images using the syntax
import img from '~/assets/img.jpg'

It works just fine, but it seems the typescript functionality in vscode doesn't like it.
To reproduce, create a new nuxt project, insert an image into the assets directory and reference it in an import.
image.png
Was this page helpful?