Closed giapdong closed 1 month ago
You should add the alias to the tsconfig that includes your app.
You should add the alias to the tsconfig that includes your app.
@RayGuo-ergou What do you mean? Because I included in tsconfig/include
You only include ../uni/**/*
, so typescript server dose not know that app-a
and app-b
can also use @uni
alias.
You only include
../uni/**/*
, so typescript server dose not know thatapp-a
andapp-b
can also use@uni
alias.
I edited my issue to be clearer. My problem appears at app-a (for example, app-b also). And I registered @uni
for both tsconfig and vite.config.ts (you can re-see in my issue description).
I know that in that way it was tell to typescript that using @uni
for app-a
. So what is the wrong here?
create tsconfig.json
under app-a
does not automatically include files in app-a
you have to explicitly add to the tsconfig.
e.g.
- "include": ["../uni/**/*"],
+ "include": ["../uni/**/*", "./src/**/*"],
Both IDE error and typecheck error due to this.
Your build works because vite does not require typescript at all which mean it does not read tsconfig.json
.
create
tsconfig.json
underapp-a
does not automatically include files inapp-a
you have to explicitly add to the tsconfig.e.g.
- "include": ["../uni/**/*"], + "include": ["../uni/**/*", "./src/**/*"],
Both IDE error and typecheck error due to this. Your build works because vite does not require typescript at all which mean it does not read
tsconfig.json
.
Ah sure :D, I cutting include "./src/*/" for reduce noise and only focus on uni
module. Because I still using "dev" and "build-only" without error so it must include :D
Hey there, as there have been many fixes in the last 2.x versions: Please let us know if you're still encountering this issue. Otherwise kindly close this one, thanks!
I am building multiple apps with shared resources and here is my folder structure
⛳ In this way, I want to use uni for both
app-a
andapp-b
.Here is sample for
app-a
when using it below app-a/tsconfig.jsonapp-a/vite.config.ts
app-a/package.json
app-a/src/App.vue
With this way, I see minor error in app-a/src/App.vue:
It works well for both the dev and build-only. It only a typescript check, do not affect or crash app
But when i using command 'type-check' it make really error as this issue title
So, how i can resolve it? I really want to using type-check for safe check but with this way i must to ignore to finish build process :(( btw, if this issue done, it will affect to Volar? I don't want to see error during development time :( Thank you