NextJS 11 + SVGR + Typescript #26400
Unanswered
SalahAdDin
asked this question in
Help
Replies: 1 comment 1 reply
-
dealing with the exact same issue right now, have you found a fix yet? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello guys,
I'm migrating my portfolio from JavaScript to TypeScript and from NextJS
10
to11
.But I'm getting a problem with every SVG icon i'm importing:
TS2604: JSX element type 'GitLab' does not have any construct or call signatures.
.I followed a lot of tutorials, i tried many ways but i can't fix this; i realized the problem is the global configuration, since when i do click on the importe SVG in Visual Studio Code it always send me to the Next typescript definitions:
node_modules/next/types/global.d.ts
I deduced the way to fix it is replacing the SVG module definition by the custom one:
It is now in a
types/custom.d.ts
and I think there is not a problem importing it because i have another types and there is no problem with them; i deduce the problem is theglobal.d.ts
included on Next. It does not matter if i declare aindux.d.ts
at root project or inside of a@types
folder on the root project, it still does not work.What's the correct way to override that definition?
Thanks
Beta Was this translation helpful? Give feedback.
All reactions