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.
1 Reply
This is a problem with vscode using typescript checking instead of nuxt checking. You can disable it by making a
index.d.ts
containing: etc..