Skip to content

An alias in vite.config.ts results in "error TS2307: Cannot find module", but it works. #8240

Answered by tadashi-oya
tadashi-oya asked this question in Q&A
Discussion options

You must be logged in to vote

"declare" statement is needed in env.d.ts file.

$ cat env.d.ts
/// <reference types="vite/client" />
declare module "envConfig";

Replies: 4 comments 3 replies

Comment options

You must be logged in to vote
1 reply
@tadashi-oya
Comment options

Comment options

You must be logged in to vote
1 reply
@pedroSoaresll
Comment options

Answer selected by tadashi-oya
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@t-Oil
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
6 participants