-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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 find module 'lru-cache/min' (something wrong from @vue/compiler-sfc
)
#9521
Comments
The rewriting of On the other hand, we accidentally exposed the |
@deot thanks you |
would be ok to revert it back to ?
|
Was also experiencing the same issue today. I worked around it by changing lru-cache/min to lru-cache in compiler-sfc.d.ts. This fixed building on my side, but the issue still existed when Render (my web-hosting platform of choice) installed all packages and tried to build the project. Fixed it by creating a post-install script to patch the compiler-sfc. I then modified package.json to include it under scripts: "postinstall": "node ./scripts/fix-lru-cache-import.js" Here's the script for anyone looking for a temporary solution: https://codefile.io/f/YITb201MO5 This definitely seems like a bug though. |
I had the same issue in my project and I fixed by regressing vuejs to the 3.3.4 version. |
As both `./min` and `.` points to the same type definition file, sometimes TypeScript will resolve the type definition file to the `./min` key as it appears first. microsoft/TypeScript#56290 (comment) While this is not incorrect behavior, it breaks compatibility with older build environments that do not support the `exports` field. (e.g. TypeScript with `moduleResolution: "node"` instead of `bundler` or `node16`), as the `./min` entry is only available through the `exports` field. Some Vue.js users are experiencing this issue: vuejs/core#9521
Vue version
3.3.7
Link to minimal reproduction
link repro - 1
Steps to reproduce
open repro
What is expected?
no error
What is actually happening?
error
Any additional comments?
v3.3.4
v3.3.5
lru-cache@10.0.1
Install
lru-cache
independently is still failed because there is nolru-cache/min
;I found this problem seems to be more related to
tsc
. link repro - 2Suggestion
added
lru-cache
to dependenciescore/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.core/tsconfig.json
Line 10 in 9ca468c
npm run build-dts
if it's not a bug, please close the issue. Because
moduleResolution
property set tobundler
will work fine in my project.The text was updated successfully, but these errors were encountered: