uni-helper / uni-network

为 uni-app 打造的基于 Promise 的 HTTP 客户端
https://uni-network.netlify.app
MIT License
76 stars 8 forks source link

小程序打包提示[vite]: Rollup failed to resolve import "statuses" from #43

Closed DMzmwh closed 10 months ago

DMzmwh commented 10 months ago

描述问题

[vite]: Rollup failed to resolve import "statuses" from "D:/project/uniapp小程序-配套资料/03-code/uni-shop/node_modules/@uni-helper/uni-network/dist/index.mjs". This is most likely unintended because it can break your application at runtime. If you do want to externalize this module explicitly add it to build.rollupOptions.external``

复现

1

系统信息

Need to install the following packages:
  envinfo@7.11.0
Ok to proceed? (y)

  System:
    OS: Windows 10 10.0.19042
    CPU: (4) x64 Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz
    Memory: 1.19 GB / 7.90 GB
  Binaries:
    Node: 18.17.0 - C:\Program Files\nodejs\node.EXE
    npm: 9.6.7 - C:\Program Files\nodejs\npm.CMD
    pnpm: 8.7.1 - ~\AppData\Roaming\npm\pnpm.CMD
  Browsers:
    Chrome: bookmarks.html
initial_preferences
    Edge: Spartan (44.19041.423.0), Chromium (120.0.2210.91)
    Internet Explorer: 11.0.19041.1

使用的包管理器

npm

核对

ModyQyW commented 10 months ago

请提供复现

ModyQyW commented 10 months ago

如果你正在使用 pnpm,你应该设置 shamefully-hoist=true,参考 https://github.com/uni-helper/vitesse-uni-app/blob/main/.npmrc,同时你提交问题的时候不应该说你正在使用 npm 作为包管理器。

提交问题模板也说明了一个复现是必须的,大家的时间都很宝贵,谢谢。

DMzmwh commented 10 months ago

应该设置 shamefully-hoist=true,参考 https://github.com/uni-helper/vitesse-uni-app/blob/main/.npmrc

DMzmwh commented 10 months ago

多谢大佬