Skip to content

auto import Link Image not working vscode #30952

Answered by franco-roura
SamyZog asked this question in Help
Discussion options

You must be logged in to vote

Add a typescript declaration file with the following content

// someFile.d.ts
import Image from 'next/image'

declare module 'next/image' {
  export default Image = Image
}

Make sure it's matched by the "include" array in your tsconfig.json file.

You should start seeing this

You can do that with next/link too.

Replies: 6 comments 8 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@SamyZog
Comment options

Comment options

You must be logged in to vote
3 replies
@h0lme3
Comment options

@WhyouDev
Comment options

@sidvud98
Comment options

Answer selected by SamyZog
Comment options

You must be logged in to vote
1 reply
@franco-roura
Comment options

Comment options

You must be logged in to vote
3 replies
@franco-roura
Comment options

@lelabo-m
Comment options

@franco-roura
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
10 participants