umijs / umi

A framework in react community ✨
https://umijs.org
MIT License
15.39k stars 2.65k forks source link

更新到umi@2.5.0后编译错误 #1983

Closed leiysky closed 5 years ago

leiysky commented 5 years ago

image

看起来像是dynamic module的loader问题。

umi@2.4.4编译的结果:

import dynamic from 'umi/dynamic';
{
    "path": "/",
    "component": dynamic({ loader: () => import('../../layouts/BasicLayout'), loading: require('/Users/leiysky/work/ttarch/archcloud/src/components/PageLoading/index').default }),
    "Routes": [require('../Authorized').default],
    "routes":[],
}

umi@2.5.0编译的结果:

import _dvaDynamic from 'dva/dynamic';
{
    "path": "/",
    "component": _dvaDynamic({
      component: () => import('../../layouts/BasicLayout'),
      LoadingComponent: require('/data00/home/leiyu.leiysky/ttarch-cloud-fe/src/components/PageLoading/index').default,
}),
    "Routes": [require('../Authorized').default],
    "routes": [],
}
mlqgg commented 5 years ago

遇到了同样的错误。。。

leiysky commented 5 years ago

@mlqgg 锁的大版本,下午上线的时候崩了,回滚也崩了。。。😆

sorrycc commented 5 years ago

给个可重现的仓库?我试了下 ant-design-pro 没有发现问题。

@leiysky 回滚为啥会崩?

sorrycc commented 5 years ago

会不会是 umi 升了但插件还是老的?

jwmann commented 5 years ago

I have the same problem in ant-design-pro Here's my ticket ant-design/ant-design-pro#3548

mlqgg commented 5 years ago

在webpack的git下发现了类似的issue,然而问题的根本好像是npm的bug??? https://github.com/webpack/webpack/issues/8779

sorrycc commented 5 years ago

你们是用 npm 安装依赖?试试 yarn 和 cnpm 会不会有问题?

zhilianbi520 commented 5 years ago

遇到同样问题~!求解~

sorrycc commented 5 years ago

@zhilianbi520 先用 cnpm 或 yarn。

zhilianbi520 commented 5 years ago

@sorrycc cnpm 也有同样的问题。 npm run build jietu20190218-143833 这个报错。。粘错图了。 umi的版本是2.4.2的

sorrycc commented 5 years ago

@zhilianbi520 这个错和前面的不一样吧。

zhilianbi520 commented 5 years ago

更新"umi-plugin-react": "^1.5.0" 这个?回退webpack版本是更新这个依赖库嘛?