π Bug Report
There are no type definitions shipped with the @svgr/cli package. Because there's no main entry in that package's package.json, the .d.ts files are not generated.
I'd be happy to create a PR for this. My thinking was to add another conditional at build/rollup.config.mjs:11 such that if pkg.main doesn't exist, it looks next for pkg.types before falling back to the default './dist/index' value.
To Reproduce
- Install the
@svgr/cli dependency in a TypeScript project
- Try to import types, e.g.
import { Options } from "@svgr/cli";
- TypeScript shows the following error on the import:
Cannot find module '@svgr/cli' or its corresponding type declarations. ts(2307)
Expected behavior
The Options and SvgrCommand are shipped with the package and are importable in consuming projects.
Link to repl or repo (highly encouraged)
The issue is reproducible in this TypeScript playground.
Run npx envinfo --system --binaries --npmPackages @svgr/core,@svgr/cli,@svgr/webpack,@svgr/rollup --markdown --clipboard
Paste the results here:
## System:
- OS: macOS 26.2
- CPU: (14) arm64 Apple M4 Max
- Memory: 803.25 MB / 36.00 GB
- Shell: 5.9 - /bin/zsh
## Binaries:
- Node: 22.20.0 - ~/.asdf/installs/nodejs/22.20.0/bin/node
- npm: 10.9.3 - ~/.asdf/plugins/nodejs/shims/npm
- pnpm: 10.18.1 - ~/.asdf/shims/pnpm
## npmPackages:
- @svgr/cli: ^8.1.0 => 8.1.0
- @svgr/core: ^8.1.0 => 8.1.0
π Bug Report
There are no type definitions shipped with the
@svgr/clipackage. Because there's nomainentry in that package'spackage.json, the.d.tsfiles are not generated.I'd be happy to create a PR for this. My thinking was to add another conditional at
build/rollup.config.mjs:11such that ifpkg.maindoesn't exist, it looks next forpkg.typesbefore falling back to the default'./dist/index'value.To Reproduce
@svgr/clidependency in a TypeScript projectimport { Options } from "@svgr/cli";Cannot find module '@svgr/cli' or its corresponding type declarations. ts(2307)Expected behavior
The
OptionsandSvgrCommandare shipped with the package and are importable in consuming projects.Link to repl or repo (highly encouraged)
The issue is reproducible in this TypeScript playground.
Run
npx envinfo --system --binaries --npmPackages @svgr/core,@svgr/cli,@svgr/webpack,@svgr/rollup --markdown --clipboardPaste the results here: