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

TS errors when importing #209

Closed
mnpqraven opened this issue Aug 14, 2023 · 5 comments
Closed

TS errors when importing #209

mnpqraven opened this issue Aug 14, 2023 · 5 comments

Comments

@mnpqraven
Copy link

Describe the bug
In the new version of 'react-inlinesvg' the return type of the component contains undefined and will lead to typescript errors. I have my repo setup to cancel builds when there are typescript errors and therefore can't build with the current version of 'react-inlinesvg'. For now I've downgraded to 3.0.3 and it works without errors

image

Link to repl or repo (highly encouraged)
The errors can be seen at the example codesandbox

@gilbarbara
Copy link
Owner

Hey @mnpqraven
You probably need to update your types.

@gilbarbara
Copy link
Owner

Or your typescript version.
Codesandbox VS code editor uses typescript 4.x, but the bundler uses 5.x. That's why you see the errors in the editor, but it renders without issues.

@mnpqraven
Copy link
Author

I've upgraded @types/react to the required version (^18.2.20 even). There's no longer errors in the editors but those errors will still appear during build and cancel build for me.
For context this is typescript 5 and on the latest version of nextjs

@mnpqraven
Copy link
Author

I've managed to solve the errors during build by bumping typescript from 5.0.1 to 5.1.6. I think just ts 5 is not enough and you might still need a newer ts release.

@gilbarbara
Copy link
Owner

@mnpqraven The library does not have TypeScript as a dependency. It uses the host app version.

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