alitajs / alita

A React framework based on umi.
https://alitajs.com
MIT License
792 stars 87 forks source link

umi4使用@alitajs/hd启动报错 #489

Closed baobao12356 closed 1 year ago

baobao12356 commented 1 year ago

umi3升级umi4的的项目,配置了plugins: ['@alitajs/hd'], hd: { px2rem: { rootValue: 100, selectorDoubleRemList: [/.za-/], unitPrecision: 5, ignoreIdentifier: 'no', minPixelValue: 2, exclude: /(node_module)/, }, }, 启动的时候报错

fatal - TypeError: Cannot read property 'getFile' of undefined at _default (/Users/guoerbao/Desktop/project/gitlab/upgrade/dm-active-ui/node_modules/@alitajs/hd/lib/index.js:37:29) at Service.initPlugin (/Users/guoerbao/Desktop/project/gitlab/upgrade/dm-active-ui/node_modules/@umijs/core/dist/service/service.js:352:40) at Service.run (/Users/guoerbao/Desktop/project/gitlab/upgrade/dm-active-ui/node_modules/@umijs/core/dist/service/service.js:218:18) at processTicksAndRejections (internal/process/task_queues.js:95:5) at async Service.run2 (/Users/guoerbao/Desktop/project/gitlab/upgrade/dm-active-ui/node_modules/umi/dist/service/service.js:58:12) at async /Users/guoerbao/Desktop/project/gitlab/upgrade/dm-active-ui/node_modules/umi/dist/cli/forkedDev.js:24:5 fatal - A complete log of this run can be found in: fatal - /Users/guoerbao/Desktop/project/gitlab/upgrade/dm-active-ui/node_modules/.cache/logger/umi.log fatal - Consider reporting a GitHub issue on https://github.com/umijs/umi/issues 请问该怎么处理啊

image
xiaohuoni commented 1 year ago

plugins:['@alita/plugins/dist/hd']