umi + antd pro代码 在编辑器报警的解决方案

前言:umi+antd pro工程,创建后,使用起来的时候毛病多。

 

2,在webstorm编辑器报错

TS2686: 'React' refers to a UMD global, but the current file is a module. Consider adding an import instead.

查资料说配置:

https://stackoverflow.com/questions/64656055/react-refers-to-a-umd-global-but-the-current-file-is-a-module


What Dan wrote is correct you can change TS config.json:

// tsconfig.json
{
  "compilerOptions": {
    ...
    "jsx": "react-jsx"
    ...
  },
}

其实已经配置了。

在vscode里没有这个问题。

 

1,启动错误,必须加sudo pnpm dev

解决办法:sudo chown -R 777 project-name。 766都不行。

 

posted @ 2023-07-06 11:37  走走停停走走  Views(243)  Comments(0Edit  收藏  举报