Type error
See original GitHub issueHi,
Thanks for this loader! I’m using it in Vue 3 with TypeScript, and I’m getting the following Vetur warning in VS Code for each SVG in the line that says something like components: { MyLogo }
:
No overload matches this call.
The last overload gave the following error.
Type 'string' is not assignable to type 'Component<any, any, any, Record<string, ComputedGetter<any> | WritableComputedOptions<any>>, MethodOptions>'
Is there a way to inform TypeScript that the result of that import { MyLogo } from "mylogo.svg"
will, in fact, be a Component, not a string?
Everything still works fine, it’s just a red-squiggly issue.
Issue Analytics
- State:
- Created 3 years ago
- Comments:11 (4 by maintainers)
Top Results From Across the Web
Type I and type II errors - Wikipedia
The type I error rate is the probability of rejecting the null hypothesis given that it is true. · The rate of the...
Read more >Type Errors - learn how to fix these - Codecademy
Type Errors : these show up when a value is not the expected type. In the sections below you will find the different...
Read more >How to Fix TypeError Exceptions in Python - Rollbar
The Python TypeError is an exception that occurs when the data type of an object in an operation is inappropriate.
Read more >ERROR.TYPE function - Microsoft Support
This article describes the formula syntax and usage of the ERROR.TYPE function in Microsoft Excel. Description. Returns a number corresponding to one of...
Read more >Type I & Type II Errors | Differences, Examples, Visualizations
In statistics, a Type I error is a false positive conclusion, while a Type II error is a false negative conclusion.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
hi, maybe vite/client types is conflicting with your declaration in Vite 2. I’m getting this error
I don’t know if you can override, but Vite 2 provide types for svg. Doc: https://vitejs.dev/guide/features.html#client-types
This is fixed in version 2.0.3. You’ll need to use the
?component
param when importing your svg files in a TypeScript project: