Skip to content

Cannot find module './left.png' or its corresponding type declarations.ts(2307)  #169

@beqramo

Description

@beqramo

Hi, I can't declare module for png,

declare module '*.png' {
  const image: number;
  export default image;
}

I tried my default configuration of tsconfig.json that I'm using in all project but here it didn't worked and what I'm doing wrong?

{
  "compilerOptions": {
    "baseUrl": "./",
    "paths": {
      "react-native-gerru": ["./src/index"]
    },
    "allowUnreachableCode": false,
    "allowUnusedLabels": false,
    "esModuleInterop": true,
    "importsNotUsedAsValues": "remove",
    "forceConsistentCasingInFileNames": true,
    "jsx": "react",
    "lib": ["esnext"],
    "module": "esnext",
    "moduleResolution": "node",
    "noFallthroughCasesInSwitch": true,
    "noImplicitReturns": true,
    "noImplicitUseStrict": false,
    "noStrictGenericChecks": false,
    "noUnusedLocals": true,
    "noUnusedParameters": true,
    "noImplicitAny": false,
    "resolveJsonModule": true,
    "skipLibCheck": true,
    "strict": true,
    "target": "esnext",
    "allowJs": true,
    "allowSyntheticDefaultImports": true,
    "isolatedModules": true,
    "removeComments": true,
    "allowUmdGlobalAccess": true,
    "declaration": true,
    "declarationDir": "./src"
  },
  "include": ["./src/global.d.ts"],
  "exclude": ["./example"]
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions