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

frontend build error with lodash/throttle #3310

Open
avatasia opened this issue Jun 17, 2024 · 1 comment
Open

frontend build error with lodash/throttle #3310

avatasia opened this issue Jun 17, 2024 · 1 comment

Comments

@avatasia
Copy link

code version:
commit eb3978e (HEAD -> master, origin/master, origin/HEAD)
Author: Oleg Lobanov [email protected]
Date: Sat Jun 8 22:20:58 2024 +0200

local env:
windows 11
node 20

op:
pnpm install
pnpm run build

error info:

D:\github\filebrowser\frontend>pnpm run build

> [email protected] build D:\github\filebrowser\frontend
> npm run typecheck && vite build


> [email protected] typecheck
> vue-tsc -p ./tsconfig.json --noEmit

src/components/files/ExtendedImage.vue:17:22 - error TS2307: Cannot find module 'lodash/throttle' or its corresponding type declarations.

17 import throttle from "lodash/throttle";
                        ~~~~~~~~~~~~~~~~~

src/stores/upload.ts:4:22 - error TS2307: Cannot find module 'lodash/throttle' or its corresponding type declarations.

4 import throttle from "lodash/throttle";
                       ~~~~~~~~~~~~~~~~~

src/views/files/FileListing.vue:288:22 - error TS2307: Cannot find module 'lodash/throttle' or its corresponding type declarations.

288 import throttle from "lodash/throttle";
                         ~~~~~~~~~~~~~~~~~

src/views/files/Preview.vue:139:22 - error TS2307: Cannot find module 'lodash/throttle' or its corresponding type declarations.

139 import throttle from "lodash/throttle";
                         ~~~~~~~~~~~~~~~~~


Found 4 errors in 4 files.

Errors  Files
     1  src/components/files/ExtendedImage.vue:17
     1  src/stores/upload.ts:4
     1  src/views/files/FileListing.vue:288
     1  src/views/files/Preview.vue:139
 ELIFECYCLE  Command failed with exit code 2.

the config in package.json is:
"lodash-es": "^4.17.21",
and directory name in node_modules is:
[email protected]
import code is:
import throttle from "lodash/throttle";

the config of my local vue 3 project like this:
"@types/lodash": "^4.14.195",
"lodash": "^4.17.21",

@avatasia
Copy link
Author

Just solved.
replace lodash/throttle to lodash-es/throttle.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant