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

Cannot use vite/client types in Deno #26224

Open
redabacha opened this issue Oct 14, 2024 · 1 comment
Open

Cannot use vite/client types in Deno #26224

redabacha opened this issue Oct 14, 2024 · 1 comment
Labels
2.0 feedback bug Something isn't working correctly tsc related to the TypeScript tsc compiler

Comments

@redabacha
Copy link

Version: Deno 2.0.0

adding a reference to the vite client type declarations should let you use import.meta.env amongst other things as described here https://vite.dev/guide/features#client-types. however this does not work when using the Deno typechecker, when adding the reference, nothing seems to have changed and import.meta.env will continue to error.

@littledivy littledivy added bug Something isn't working correctly 2.0 feedback labels Oct 14, 2024
@lucacasonato lucacasonato added the tsc related to the TypeScript tsc compiler label Oct 21, 2024
@Robin-Hoodie
Copy link

Robin-Hoodie commented Oct 27, 2024

I am getting the error Module '"file:///my/local/path/some-image.png"' has no default export when type checking the file below w/ deno check:

/// <reference types="npm:vite/client" />

import logoMainSrc from "@/assets/logo-main.png";

Seems to be related as vite/client.d.ts includes among other things the below

declare module '*.png' {
  const src: string
  export default src
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.0 feedback bug Something isn't working correctly tsc related to the TypeScript tsc compiler
Projects
None yet
Development

No branches or pull requests

4 participants