运行ant-design-pro报错ERROR in ./node_modules/swagger-ui-react/swagger-ui.js 2:107055-107070Module not

劳高爽
2023-12-01

报错内容: 

ERROR in ./node_modules/swagger-ui-react/swagger-ui.js 2:107055-107070
Module not found: Error: Can't resolve 'btoa' in 'D:\ant-design-pro\myapp\node_modules\swagger-ui-react'
 @ ./node_modules/swagger-ui-react/index.js 13:0-61 59:15-35 65:53-65
 @ ./src/.umi/.cache/.mfsu/mf-va_swagger-ui-react.js 1:0-33 2:15-16
 @ container entry ./swagger-ui-react[0]

webpack compiled with 1 error
null
Error: build failed
    at D:\ant-design-pro\myapp\node_modules\@umijs\bundler-webpack\lib\index.js:172:29
    at D:\ant-design-pro\myapp\node_modules\@umijs\deps\compiled\webpack\5\bundle5.js:114591:14
    at processQueueWorker (D:\ant-design-pro\myapp\node_modules\@umijs\deps\compiled\webpack\5\bundle5.js:114529:6)
    at processTicksAndRejections (node:internal/process/task_queues:78:11)

 

解决办法:

yarn add swagger-ui-react --save

yarn start

 

 类似资料: