关于 vue-antd-pro 项目 npm run serve 之后出现的一系列问题
哈,很久没写过随笔了,心情激荡
前景简要:
在运行项目时出了些问题,问题1如下
ValidationError: Invalid options object. Ignore Plugin has been initialized using an options object that does not match the API schema.
- options should be one of these:
object { resourceRegExp, contextRegExp? } | object { checkResource }
Details:
* options misses the property 'resourceRegExp'. Should be:
RegExp
-> A RegExp to test the request against.
* options misses the property 'checkResource'. Should be:
function
-> A filter function for resource and context.
ValidationError: Invalid options object. Ignore Plugin has been initialized using an options object that does not match the API schema.
翻译 Invalid options object. Ignore Plugin has been initialized using an options object that does not match the API schema. : 无效的选项对象。忽略插件已使用与API模式不匹配的选项对象进行初始化。
我开始认真琢磨(百度)
成功找到了以下解决方案
- 删除项目内nodemodules的webpackpack所有版本, 执行 cnpm install webpack@4.46.0 --save-dev (亲测)
- vue.config.js (未测)
configureWebpack: { plugins: [ // Ignore all locale files of moment.js // new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/), // 修改为这样: new webpack.IgnorePlugin({ resourceRegExp: /^\.\/locale$/, contextRegExp: /moment$/, }), createThemeColorReplacerPlugin(), ], },
参考博文:
https://blog.csdn.net/baidu_28753677/article/details/125427526
https://www.jianshu.com/p/ce64c76dcbda
好的问题解决了,抬走下一个
之后重新 serve 出现了问题2,如下
error in ./src/components/NumberInfo/NumberInfo.vue?vue&type=style&index=0&id=4370c5af&lang=less&scoped=true&
Syntax Error: TypeError: Cannot set properties of undefined (setting ‘parent’)
经过细密的研究之后发现了以下几个解决方案
- 把yarn.lock、node_modules删除,然后重新执行yarn install, npm run serve (无用)
- 删掉 components 文件夹下的NumberInfo 文件夹,再启动项目,启动之后, Ctrl + z 撤回删除的 NumberInfo 组件文件夹,之后,项目就可以正常启动了 (无用)
- 注释掉 /src/components/NumberInfo/NumberInfo.vue style 里面的 @import "index" (有效)
参考博文:
https://blog.csdn.net/weixin_44488149/article/details/125875450
好了,问一下,还有谁!
结尾问一个问题,为什么都是从一个库里面 clone 下来的代码 为何我可以顺利运行成功,而同事却出现了两三个问题
The most terrible person in the world is yourself
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· 没有Manus邀请码?试试免邀请码的MGX或者开源的OpenManus吧
· 园子的第一款AI主题卫衣上架——"HELLO! HOW CAN I ASSIST YOU TODAY
· 【自荐】一款简洁、开源的在线白板工具 Drawnix