Avatar ·

Error importing SVG files in TypeScript: Cannot find module or incorrect type

Hello everyone! I'm new to TypeScript and encountered a problem when trying to import SVG files into a React project. I have an icon component: ```typescript import React from 'react'; import { ReactComponent as Logo } from './logo.svg'; const Header: React.FC = () => { return (
); }; export default Header; ``` But TypeScript throws an error: `Cannot find module './logo.svg' or its corresponding type declarations.` I checked — the file exists, the path is correct. If I use `require('./logo.svg')`, I get the `any` type, which is also unsatisfactory. My `tsconfig.json` looks like this: ```json { "compilerOptions": { "target": "ES5", "module": "ESNext", "strict": true, "jsx": "react-jsx", "