Closed filipwronski closed 4 years ago
It should be in a file name custom.d.ts
Hello @filipwronski, @sam3d I'm having the same issue and I was wondering if you were able to fix it. Thank you!
For those looking for a solution, this worked for me:
Create a file named custom.d.ts on @types directory under root:
declare module '*.svg';
On tsconfig.json, add:
"files": [ "@types/custom.d.ts" ]
@filipwronski Since you are doing ?inline your IDE is probably not mapping your import to the declaration.
What i did on my project was:
declare module '*.svg?inline' {
...
}
I hope this helps
@RozbehSharahi Where do you put this line?
@mbledkowski Create a file called svg-shim.d.ts
or something like it in your @types
or types
folder. Put
declare module '*.svg?inline' {
}
inside.
I'm using svg as module, code work and correct icon is visible, but I have typescript error:
Cannot find module '~/assets/img/icons/close-circle.svg?inline'.
Any Idea how to fix it? I have already added svg to index.d.ts