Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Help] Issue pulling in svgr types. #51

Open
mikeymop opened this issue Sep 21, 2022 · 1 comment
Open

[Help] Issue pulling in svgr types. #51

mikeymop opened this issue Sep 21, 2022 · 1 comment

Comments

@mikeymop
Copy link

I recently updated to module version 2.2.1 and noticed that I now have a hard-to-figure-out error in my tsconfig.json in relation to this plugin.

Interestingly, this is fine in my vite.config.ts. Is it expected to include tsconfig.json in it's own includes?

tsconfig.json

Cannot find type definition file for 'vite-plugin-svgr/client'.
  The file is in the program because:
    Entry point of type library 'vite-plugin-svgr/client' specified in compilerOptions

at

{
  "compilerOptions": {
    "target": "ESNext",
    "lib": ["dom", "dom.iterable", "esnext"],
    "types": ["vite/client", "@types/vite-plugin-svgr/client", "@types/react", "jest"],
    ...
    }
  "files": [ // is it expected to include tsconfig.json here?
    "vite.config.ts",
    "public/source-env.js",
  ],
  "include": [
    "src",
    "env/*.js",
    "src/**/*.test.ts",
  ]
}

package.json

"devDependencies": {
    "vite-plugin-svgr": "^2.2.1",
    ...
}
@sni-J
Copy link

sni-J commented Nov 30, 2022

@mikeymop
Is this resolved?
Seems like changing @types/vite-plugin-svgr/client -> vite-plugin-svgr/client in compilerOptions.types might help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants