build报错: ERROR Could not resolve "./explore/index" from "../../mini/mini_app/pages/index/index.vue"

作者
2025-04-02阅读 20

1、背景

我是用的开源的dataease,本地想打包发布到服务器上

本地npm run dev 是没问题的,能够正常的运行,但是当我build的时候,报错

 ERROR  Could not resolve "./explore/index" from "../../mini/mini_app/pages/index/index.vue"                                                  09:33:55  
file: D:/Git/mini/mini_app/pages/index/index.vue


 ERROR  error during build:                                                  09:33:55  
RollupError: Could not resolve "./explore/index" from "../../mini/mini_app/pages/index/index.vue"
    at error (file:///D:/Git/bi/dataease-frontend/node_modules/rollup/dist/es/shared/node-entry.js:2287:30)
    at ModuleLoader.handleInvalidResolvedId (file:///D:/Git/bi/dataease-frontend/node_modules/rollup/dist/es/shared/node-entry.js:24860:24)
    at file:///D:/Git/bi/dataease-frontend/node_modules/rollup/dist/es/shared/node-entry.js:24822:26

Note: This command was run via npm module 'win-node-env'

2、解决办法

我网上找了好多资料,都没有解决我的问题,这里说一下我最后偶然操作下解决的方式

我发现找index老是找到了我的另外一个项目的目录中去,由于项目变动,我把那个项目的文件夹删掉了

也就是错误提示中的:D:/Git/mini/mini_app

然后我尝试build之后就不报错了。。。。。。。。



全部评论

头像
乌兔
前端开发
私信
获得点赞 445
文章被阅读 31,261