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

TypeScript error when using width parameter #371

Closed
kevinrenskers opened this issue Aug 25, 2022 · 2 comments
Closed

TypeScript error when using width parameter #371

kevinrenskers opened this issue Aug 25, 2022 · 2 comments

Comments

@kevinrenskers
Copy link

This works fine:

import MyImage from "$lib/assets/my-image.png";

But this gives a TypeScript error:

import MyImage from "$lib/assets/my-image.png?width=570";
// Cannot find module '$lib/assets/my-image.png?width=570' or its corresponding type declarations.

Mind you the actual image works fine, nothing is broken, but I'd really like to have zero TS errors in my project. Any idea on how to solve this?

@romanran
Copy link

#160

@kevinrenskers
Copy link
Author

Thanks, #160 (comment) is a fine workaround.

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