Closed ehrencrona closed 4 years ago
This is correct behavior. Typescript by default cannot deal with anything else than ts/js files.
You need to add an ambient module declaration to silence the error:
ambient.d.ts
declare module "*.png"
Also see https://stackoverflow.com/questions/51100401/typescript-image-import
Can we move the ticket to sapper-template
instead to add the declaration? It's not good that svelte-check
returns an error on the default project.
svelte-check
reports an error when using TypeScript on the image imports used in the Sapper template project:The images are located in
src/node_modules/images
(since sveltejs/sapper-template#248). This is closely related to sveltejs/language-tools#610 but in this case it issvelte-check
that reports an error whereas for sveltejs/language-tools#610 the error only displays in VSCode, so I suspect it's two different issues.To Reproduce
Ping @benmccann
Versions Svelte for VSCode v102.2.0 sapper template Sapper 0.28.10 Svelte 3.29.0 Svelte-check 1.0.59