#Cannot find type declarations of public/images/*.svg

4 messages · Page 1 of 1 (latest)

digital prawn
#

I've a type declaration file at src/typigns.d.ts with declare module *.svg and a meriad of other image filetypes yet the errors remain. What am I doing wrong?

declare module "*.json";
declare module "*.png";
declare module "*.scss";
declare module "*.svg";
crude minnowBOT
#

🔎 This post has been indexed in our web forum and will be seen by search engines so other users can find it outside Discord

🕵️ Your user profile is private by default and won't be visible to users outside Discord, if you want to be visible in the web forum you can add the "Public Profile" role in id:customize

✅ You can mark a message as the answer for your post with Right click -> Apps -> Mark Solution
(if you don't see the option, try refreshing Discord with Ctrl + R)

digital prawn
#

My TSConfig:

{
    "$schema": "https://json.schemastore.org/tsconfig",
    "compilerOptions": {
        "allowImportingTsExtensions": true,
        "allowJs": true,
        "baseUrl": ".",
        "esModuleInterop": true,
        "forceConsistentCasingInFileNames": true,
        "incremental": true,
        "isolatedModules": true,
        "jsx": "preserve",
        "lib": ["DOM", "DOM.Iterable", "ESNext"],
        "module": "ESNext",
        "moduleResolution": "Bundler",
        "noEmit": true,
        "paths": {
            "@/*": ["./src/*"],
            "~/*": ["./*"]
        },
        "plugins": [
            {
                "name": "next"
            }
        ],
        "resolveJsonModule": true,
        "skipLibCheck": true,
        "strict": true,
        "target": "ESNext"
    },
    "exclude": ["node_modules", "packages"],
    "include": [
        "./*.{ts,tsx}",
        "./__tests__/**/*",
        "./scripts/**/*",
        "./src/**/*",
        ".next/types/**/*.ts"
    ]
}
#

Found out the hard way that *Configs don't support globs, just changed my include to this:

"include": ["**/*.ts", "**/*.tsx", ".next/types/**/*.ts"]