Closed
Description
Vue version
3.3.7
Link to minimal reproduction
Steps to reproduce
What is expected?
no error
What is actually happening?
error
node_modules/.pnpm/@vue+compiler-sfc@3.3.7/node_modules/@vue/compiler-sfc/dist/compiler-sfc.d.ts:1:32 - error TS2307: Cannot find module 'lru-cache/min' or its corresponding type declarations.
1 import * as lru_cache_min from 'lru-cache/min'
Found 1 error in node_modules/.pnpm/@vue+compiler-sfc@3.3.7/node_modules/@vue/compiler-sfc/dist/compiler-sfc.d.ts:1
Any additional comments?
lru-cache@10.0.1
Install lru-cache
independently is still failed because there is no lru-cache/min
;
I found this problem seems to be more related to tsc
. link repro - 2
Suggestion
-
added
lru-cache
to dependencies
core/packages/compiler-sfc/package.json
Line 50 in 9ca468c
-
set
node
instead ofbundler
onmoduleResolution
property or only instead for build(tsconfig.build.json
), it will work fine.
Line 10 in 9ca468c
if it's not a bug, please close the issue. Because moduleResolution
property set to bundler
will work fine in my project.