HarmonyOS 鸿蒙Next 快应用开发:webpack和fa-toolkit冲突问题 HarmonyOS 鸿蒙Next环境下,快应用开发遇到webpack和fa-toolkit冲突 在联盟IDE开发无异常,转至huaweiide即出现webpack和fa-toolkit冲突,求解
HarmonyOS 鸿蒙Next 快应用开发:webpack和fa-toolkit冲突问题
HarmonyOS 鸿蒙Next环境下,快应用开发遇到webpack和fa-toolkit冲突
在联盟IDE开发无异常,转至huaweiide即出现webpack和fa-toolkit冲突,求解
Build begin...0%
> weather@2.0.0 fa-watch
> node node_modules/webpack/bin/webpack.js --watch --config ./node_modules/fa-toolkit/webpack.config.js
f:\Quick_App_demo\weather-huaiwei\node_modules\fa-toolkit\node_modules\webpack\lib\NormalModule.js:227
throw new TypeError(
^
TypeError: The 'compilation' argument must be an instance of Compilation
at NormalModule.getCompilationHooks (f:\Quick_App_demo\weather-huaiwei\node_modules\fa-toolkit\node_modules\webpack\lib\NormalModule.js:227:10)
at f:\Quick_App_demo\weather-huaiwei\node_modules\fa-toolkit\node_modules\webpack\lib\LoaderOptionsPlugin.js:46:17
at Hook.eval [as call] (eval at create (f:\Quick_App_demo\weather-huaiwei\node_modules\tapable\lib\HookCodeFactory.js:19:10), :100:1)
at Hook.CALL_DELEGATE [as _call] (f:\Quick_App_demo\weather-huaiwei\node_modules\tapable\lib\Hook.js:14:14)
at Compiler.newCompilation (f:\Quick_App_demo\weather-huaiwei\node_modules\webpack\lib\Compiler.js:1275:26)
at f:\Quick_App_demo\weather-huaiwei\node_modules\webpack\lib\Compiler.js:1319:29
at Hook.eval [as callAsync] (eval at create (f:\Quick_App_demo\weather-huaiwei\node_modules\tapable\lib\HookCodeFactory.js:33:10), :6:1)
at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (f:\Quick_App_demo\weather-huaiwei\node_modules\tapable\lib\Hook.js:18:14)
at Compiler.compile (f:\Quick_App_demo\weather-huaiwei\node_modules\webpack\lib\Compiler.js:1314:28)
at f:\Quick_App_demo\weather-huaiwei\node_modules\webpack\lib\Watching.js:229:19
Node.js v18.19.1
RealTimeCompile service has been closed!
package.josn依赖
{
"name": "xxxx",
"version": "2.0.0",
"description": "Quickapp Sample Template",
"scripts": {
"start": "hap server --watch",
"server": "hap server",
"build": "hap build",
"release": "hap release",
"watch": "hap watch",
"debug": "hap debug",
"gen": "node ./scripts/gen/index.js",
"precommit-msg": "echo '🚧 start pre-commit checks ...' && exit 0",
"prettier": "node ./scripts/selfCloseInputTag.js && prettier --write \"src/**/*.{ux,js,json,less,scss,css,pcss,md,vue}\"",
"prettier-watcher": "onchange '**/*.md' \"src/**/**/*.{ux,js,json,less,scss,css,pcss,md,vue}\" -- prettier --write {{changed}}",
"fa-build": "node node_modules/webpack/bin/webpack.js --config ./node_modules/fa-toolkit/webpack.config.js",
"fa-watch": "node node_modules/webpack/bin/webpack.js --watch --config ./node_modules/fa-toolkit/webpack.config.js",
"fa-release": "node ./node_modules/cross-env/src/bin/cross-env.js uglifyjs=true sign=release node_modules/webpack/bin/webpack.js --config ./node_modules/fa-toolkit/webpack.config.js"
},
"dependencies": {
"crypto-js": "^4.2.0"
},
"devDependencies": {
"@babel/runtime": "^7.12.5",
"@types/quickapp": "npm:quickapp-interface@^1.0.0",
"colors": "^1.4.0",
"cross-env": "^7.0.2",
"css-loader": "^7.1.2",
"fa-toolkit": "^14.0.1-Stable.300",
"husky": "^7.0.1",
"less": "^4.1.1",
"less-loader": "^10.0.1",
"lint-staged": "^11.0.1",
"onchange": "^5.2.0",
"prettier": "^2.3.2",
"prettier-plugin-ux": "^0.3.0",
"style-loader": "^4.0.0",
"webpack": "^5.76.2"
},
"prettier": {
"singleQuote": true,
"semi": false,
"printWidth": 80,
"proseWrap": "never",
"tabWidth": 2
},
"husky": {
"hooks": {
"pre-commit": "yarn run precommit-msg && lint-staged"
}
},
"lint-staged": {
"**/**.{ux,js,json,less,scss,css,pcss,md,vue}": [
"prettier --write",
"git add"
]
},
"keywords": [
"快应用",
"快应用示例",
"快应用模版"
],
"browserslist": [
"chrome 65"
]
}
更多关于HarmonyOS 鸿蒙Next 快应用开发:webpack和fa-toolkit冲突问题 HarmonyOS 鸿蒙Next环境下,快应用开发遇到webpack和fa-toolkit冲突 在联盟IDE开发无异常,转至huaweiide即出现webpack和fa-toolkit冲突,求解的实战系列教程也可以访问 https://www.itying.com/category-93-b0.html
您好,您的问题需要进一步分析,请您通过在线提单进一步解决:https://developer.huawei.com/consumer/cn/support/feedback/#/,感谢您的反馈和支持。
更多关于HarmonyOS 鸿蒙Next 快应用开发:webpack和fa-toolkit冲突问题 HarmonyOS 鸿蒙Next环境下,快应用开发遇到webpack和fa-toolkit冲突 在联盟IDE开发无异常,转至huaweiide即出现webpack和fa-toolkit冲突,求解的实战系列教程也可以访问 https://www.itying.com/category-93-b0.html
在HarmonyOS 鸿蒙Next环境下进行快应用开发时,若遇到webpack和fa-toolkit冲突问题,特别是在从联盟IDE转到huaweiide时发生,可能是由于环境配置差异或版本不兼容导致。
针对此问题,可以尝试以下步骤解决:
-
核对版本:确保webpack和fa-toolkit的版本与HarmonyOS 鸿蒙Next环境的要求相匹配。查看官方文档或更新日志,确认是否有关于版本兼容性的说明。
-
清理缓存:在huaweiide中,尝试清理项目缓存和依赖,重新运行安装命令,看是否能解决问题。
-
配置文件检查:仔细检查webpack配置文件(如webpack.config.js),确保配置正确无误,特别是与fa-toolkit相关的部分。
-
环境隔离:考虑使用虚拟机或Docker容器等环境隔离技术,模拟联盟IDE的开发环境,看是否能复现问题,从而定位是环境差异还是代码问题。
-
查看日志:详细查看构建和运行时的日志输出,寻找可能的错误信息或警告,这些信息往往能提供解决问题的线索。
如果问题依旧没法解决请联系官网客服,官网地址是 https://www.itying.com/category-93-b0.html