gregberge / svgr

Transform SVGs into React components 🦁
https://react-svgr.com
MIT License
10.59k stars 422 forks source link

Compiler errors with svgr 7 with "skipLibCheck": false #904

Open 1EDExg0ffyXfTEqdIUAYNZGnCeajIxMWd2vaQeP opened 1 year ago

1EDExg0ffyXfTEqdIUAYNZGnCeajIxMWd2vaQeP commented 1 year ago

πŸ› Bug Report

I'm getting compiler errors with svgr 7 with "skipLibCheck": false

node_modules/@svgr/core/dist/index.d.ts:1:25 - error TS2307: Cannot find module 'prettier' or its corresponding type declarations.

1 import { Options } from 'prettier';
                          ~~~~~~~~~~

node_modules/@svgr/core/dist/index.d.ts:2:36 - error TS2307: Cannot find module 'svgo' or its corresponding type declarations.

2 import { Config as Config$1 } from 'svgo';
                                     ~~~~~~

Found 2 errors in the same file, starting at: node_modules/@svgr/core/dist/index.d.ts:1

To Reproduce

Steps to reproduce the behavior: See https://github.com/1EDExg0ffyXfTEqdIUAYNZGnCeajIxMWd2vaQeP/svgr-7-compiler-error/tree/b66511f30a53c3ba7b36df478a964b780bdef4ae

Expected behavior

No compiler error

Link to repl or repo (highly encouraged)

See https://github.com/1EDExg0ffyXfTEqdIUAYNZGnCeajIxMWd2vaQeP/svgr-7-compiler-error/tree/b66511f30a53c3ba7b36df478a964b780bdef4ae

System info

## System:
 - OS: Linux 5.15 Ubuntu 20.04.6 LTS (Focal Fossa)
 - CPU: (2) x64 AMD EPYC 7763 64-Core Processor
 - Memory: 4.98 GB / 7.75 GB
 - Container: Yes
 - Shell: 5.0.17 - /bin/bash
## Binaries:
 - Node: 20.6.1 - ~/nvm/current/bin/node
 - Yarn: 1.22.19 - /usr/bin/yarn
 - npm: 9.8.1 - ~/nvm/current/bin/npm
 - pnpm: 8.7.5 - ~/nvm/current/bin/pnpm
## npmPackages:
 - @svgr/core: ^7.0.0 => 7.0.0 

If v7 is not supported anymore, you can of course close this issue.

1EDExg0ffyXfTEqdIUAYNZGnCeajIxMWd2vaQeP commented 1 year ago

I checked with v8.1.0 and sadly the problem is not fixed yet