1.node -v : v8.12.0
2.npm -v : 6.4.1
3.本地npm start之后,可以正常启动

4.npm run build之后,将dist文件夹放到nginx配置,访问报错,umi.js:1 TypeError: n.load is not a function

5.将他人build之后的dist文件夹放到我的nginx服务器上,可以正常访问。
6.将依赖node_modules删除并重新很多次,依旧报错
7.V1版本可以正常使用,仅V2版本报错
8.怀疑是环境问题,始终没有解决,不知各位大神能否复现?请协助解决,谢谢!
Translation of this issue:
1.node -v : v8.12.0
2.npm -v : 6.4.1


I also have the same problem , have you solved it ?
me too
use react-loadable replace dva/dynamic can solve,
https://github.com/ant-design/ant-design-pro/pull/1775
npm clean cache --force
终极解决方案:node卸载重装
@wuth10 这个问题你是怎么解决的?我也遇到了
@wuth10 node重装还是遇到了这个问题,请问下最后是怎么解决的
windows环境吗?可以试下系统自带的cmd运行npm start
找到问题了,是因为我用vscode打包的,请遇到这个问题的同学在cmd下打包,切记不可在vscode里!至于是什么问题,恐怕也只有官方能排查了
使用 dva/dynamic 时出错。
this._load() is not a Function
新建 webpack.config.js,内容如下:
module.exports = function (webpackConfig) {
const m = webpackConfig.resolve.modules.pop();
webpackConfig.resolve.modules.unshift(m);
return webpackConfig;
};
@xiaohuoni 原因是啥?
@afc163 报告,我也不知道。群里看到云谦的答复,顺手转过来的
出错排查
问题
使用
dva/dynamic时出错。this._load() is not a Function解决
新建
webpack.config.js,内容如下:module.exports = function (webpackConfig) { const m = webpackConfig.resolve.modules.pop(); webpackConfig.resolve.modules.unshift(m); return webpackConfig; };
Can you describe where to put this file? I am getting the same problem on a deployment to an azure web app, but things work fine locally.
找到问题了,是因为我用vscode打包的,请遇到这个问题的同学在cmd下打包,切记不可在vscode里!至于是什么问题,恐怕也只有官方能排查了
npm build放在cmd运行完美解决问题,感谢!!!