vue-hooks-plus icon indicating copy to clipboard operation
vue-hooks-plus copied to clipboard

在uni项目pnpm安装完后运行提示没有相关依赖

Open fiveiiii opened this issue 1 month ago • 1 comments

"vue-hooks-plus": "^2.4.1",

Image

fiveiiii avatar Nov 08 '25 01:11 fiveiiii

Thank you for your contribution. We will check and reply to you as soon as possible.

github-actions[bot] avatar Nov 08 '25 01:11 github-actions[bot]

你好,能否贴出更多的相关信息呢。

XiaoDaiGua-Ray avatar Nov 18 '25 09:11 XiaoDaiGua-Ray

X [ERROR] Could not resolve "lodash-es/throttle"

node_modules/vue-hooks-plus/es/useThrottleFn/index.js:1:21:
  1 │ import throttle from "lodash-es/throttle";
    ╵                      ~~~~~~~~~~~~~~~~~~~~

You can mark the path "lodash-es/throttle" as external to exclude it from the bundle, which will remove this error and leave the unresolved path in the bundle.

X [ERROR] Could not resolve "js-cookie"

node_modules/vue-hooks-plus/es/useCookieState/index.js:1:20:
  1 │ import Cookies from "js-cookie";
    ╵                     ~~~~~~~~~~~

You can mark the path "js-cookie" as external to exclude it from the bundle, which will remove this error and leave the unresolved path in the bundle.

X [ERROR] Could not resolve "lodash-es"

node_modules/vue-hooks-plus/es/useRequest/plugins/useThrottlePlugin.js:2:25:
  2 │ import { throttle } from "lodash-es";
    ╵                          ~~~~~~~~~~~

You can mark the path "lodash-es" as external to exclude it from the bundle, which will remove this error and leave the unresolved path in the bundle.

X [ERROR] Could not resolve "screenfull"

node_modules/vue-hooks-plus/es/useFullscreen/index.js:1:23:
  1 │ import screenfull from "screenfull";
    ╵                        ~~~~~~~~~~~~

You can mark the path "screenfull" as external to exclude it from the bundle, which will remove this error and leave the unresolved path in the bundle.

X [ERROR] Could not resolve "lodash-es/debounce"

node_modules/vue-hooks-plus/es/useDebounceFn/index.js:1:21:
  1 │ import debounce from "lodash-es/debounce";
    ╵                      ~~~~~~~~~~~~~~~~~~~~

You can mark the path "lodash-es/debounce" as external to exclude it from the bundle, which will remove this error and leave the unresolved path in the bundle.

X [ERROR] Could not resolve "lodash-es/merge"

node_modules/vue-hooks-plus/es/useSetState/index.js:2:18:
  2 │ import merge from "lodash-es/merge";
    ╵                   ~~~~~~~~~~~~~~~~~

You can mark the path "lodash-es/merge" as external to exclude it from the bundle, which will remove this error and leave the unresolved path in the bundle.

X [ERROR] Could not resolve "lodash-es"

node_modules/vue-hooks-plus/es/useRequest/component-use/UseRequest.js:3:24:
  3 │ import { isEqual } from "lodash-es";
    ╵                         ~~~~~~~~~~~

You can mark the path "lodash-es" as external to exclude it from the bundle, which will remove this error and leave the unresolved path in the bundle.

X [ERROR] Could not resolve "lodash-es/cloneDeep"

node_modules/vue-hooks-plus/es/useEventEmitter/event.js:7:22:
  7 │ import cloneDeep from "lodash-es/cloneDeep";
    ╵                       ~~~~~~~~~~~~~~~~~~~~~

You can mark the path "lodash-es/cloneDeep" as external to exclude it from the bundle, which will remove this error and leave the unresolved path in the bundle.

X [ERROR] Could not resolve "lodash-es/isEqual"

node_modules/vue-hooks-plus/es/utils/useDeepCompareWithTarget.js:2:20:
  2 │ import isEqual from "lodash-es/isEqual";
    ╵                     ~~~~~~~~~~~~~~~~~~~

You can mark the path "lodash-es/isEqual" as external to exclude it from the bundle, which will remove this error and leave the unresolved path in the bundle.

X [ERROR] Could not resolve "@vue/devtools-api"

node_modules/vue-hooks-plus/es/useRequest/devtools/devtools.js:1:36:
  1 │ import { setupDevtoolsPlugin } from "@vue/devtools-api";
    ╵                                     ~~~~~~~~~~~~~~~~~~~

You can mark the path "@vue/devtools-api" as external to exclude it from the bundle, which will remove this error and leave the unresolved path in the bundle.

X [ERROR] Could not resolve "lodash-es/debounce"

node_modules/vue-hooks-plus/es/useRequest/plugins/useDebouncePlugin.js:2:21:
  2 │ import debounce from "lodash-es/debounce";
    ╵                      ~~~~~~~~~~~~~~~~~~~~

You can mark the path "lodash-es/debounce" as external to exclude it from the bundle, which will remove this error and leave the unresolved path in the bundle.

17:57:34 [vite] Build failed with 11 errors: node_modules/vue-hooks-plus/es/useCookieState/index.js:1:20: ERROR: Could not resolve "js-cookie" node_modules/vue-hooks-plus/es/useDebounceFn/index.js:1:21: ERROR: Could not resolve "lodash-es/debounce" node_modules/vue-hooks-plus/es/useEventEmitter/event.js:7:22: ERROR: Could not resolve "lodash-es/cloneDeep" node_modules/vue-hooks-plus/es/useFullscreen/index.js:1:23: ERROR: Could not resolve "screenfull" node_modules/vue-hooks-plus/es/useRequest/component-use/UseRequest.js:3:24: ERROR: Could not resolve "lodash-es" ...

fiveiiii avatar Nov 18 '25 09:11 fiveiiii

找到原因了,是uniApp "type": "module",出现的问题, 不是本库的原因

fiveiiii avatar Nov 22 '25 01:11 fiveiiii