## ๐ Bug Report **Ts error : JSX element type '...' does not have any construct or call signatures.** TypeScript declarations for SVG imports are not being properly recognized in a Next.js project. When importing SVG files, TypeScript shows them as string paths (`${string}.svg`) instead of React components as defined in the custom type declarations. ## To Reproduce 1. Set up a Next.js project with TypeScript 2. Add custom SVG type declarations to a `.d.ts` file: ```typescript declare module '*.svg' { import { FC, SVGProps } from 'react'; const content: FC<SVGProps<SVGElement>>; export default content; } declare module '*.svg?url' { const content: any; export default content; } ``` 3. Include the declaration file in `tsconfig.json` 4. Import an SVG in a component: `import login from '@/public/icons/login.svg';` 5. Observe that TypeScript shows the incorrect type: ``` (alias) module login (alias) var login: `${string}.svg` import login ``` Instead of: ``` (alias) const login: any import login ``` 6. tsconfig.json ``` "include": [ "svgr.d.ts", "**/*.ts", "**/*.mjs", "**/*.tsx", "**/*.jsx", "**/*.d.ts", "next-env.d.ts", ".next/types/**/*.ts" ], ``` ## Expected behavior TypeScript should recognize SVG imports according to the custom type declarations, showing them as React components with the proper typing. ## Additional context - The issue persists despite properly configuring the Next.js project with SVGR - TypeScript server restarts don't resolve the issue
This issue appears to be discussing a feature request or bug report related to the repository. Based on the content, it seems to be resolved. The issue was opened by salahbm and has received 2 comments.