-
-
Notifications
You must be signed in to change notification settings - Fork 437
Closed
Description
🐛 Bug Report
@svgr/core imports @svgr/babel-preset:
svgr/packages/core/src/config.ts
Line 4 in 8b9edc4
| import type { Options as TransformOptions } from '@svgr/babel-preset' |
but doesn't specify it as a dependency:
svgr/packages/core/package.json
Lines 40 to 47 in 8b9edc4
| "dependencies": { | |
| "@svgr/plugin-jsx": "^6.3.1", | |
| "camelcase": "^6.2.0", | |
| "cosmiconfig": "^7.0.1" | |
| }, | |
| "devDependencies": { | |
| "@types/svgo": "^2.6.3" | |
| } |
For the user, this causes the following error in node_modules/@svgr/core/dist/index.d.ts:
TS2307: Cannot find module '@svgr/babel-preset' or its corresponding type declarations.
and consequently Options is imported as type any.
This causes Config["template"] to have type any for the user (imported as import type { Config } from "@svgr/core";).
To Reproduce
-
Expected behavior
@svgr/core defines @svgr/babel-preset as a dependency (or other appropriate fix), so that Config["template"] has correct type instead of any.
Link to repl or repo (highly encouraged)
-
Run npx envinfo --system --binaries --npmPackages @svgr/core,@svgr/cli,@svgr/webpack,@svgr/rollup --markdown --clipboard
## System:
- OS: macOS 12.6
- CPU: (16) x64 Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
- Memory: 1.73 GB / 32.00 GB
- Shell: 5.8.1 - /bin/zsh
## Binaries:
- Node: 16.16.0 - /usr/local/bin/node
- Yarn: 1.22.19 - /usr/local/bin/yarn
- npm: 8.11.0 - /usr/local/bin/npm
## npmPackages:
- @svgr/core: 6.3.1 => 6.3.1 Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels