Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

启动报错“./node_modules/history/esm/history.js” #2032

Closed
guyongliang opened this issue Mar 16, 2019 · 9 comments
Closed

启动报错“./node_modules/history/esm/history.js” #2032

guyongliang opened this issue Mar 16, 2019 · 9 comments

Comments

@guyongliang
Copy link

guyongliang commented Mar 16, 2019

Code to reproduce the issue: (请提供可复现的代码或者步骤)

  • 1.dva new app0
  • 2.npm start

Expected behavior: (预期的正常效果)

正常进入启动页

Actual behavior: (实际效果)

报错:
./node_modules/history/esm/history.js
Module not found: Can't resolve '@babel/runtime/helpers/esm/extends' in
'“项目路径所在绝对路径”\node_modules\history\esm'

Versions of packages used: (哪个库的哪个版本出现的问题)

dva-cli version 0.10.0

将版本回退到1.0.0-beta.4 可以正常启动

@summerijs
Copy link

请问这个问题解决了吗?我也碰到这个

@guyongliang guyongliang reopened this Mar 16, 2019
@guyongliang
Copy link
Author

请问这个问题解决了吗?我也碰到这个

我是用dva-cli创建的,dva-cli的版本是0.10.0(最新的版本)。我将版本切换成1.0.0-beta.4再创建项目就可以正常启动了,具体什么原因我也没搞明白

@sorrycc
Copy link
Member

sorrycc commented Mar 17, 2019

应该和 remix-run/history@6104a6a 有关。

@sorrycc
Copy link
Member

sorrycc commented Mar 17, 2019

原因

history 发布了 4.9,roadhog 之前版本对于 @babel/runtime 的处理不恰当。

方案

试了下,有两个方案供选择,

  1. 新建 webpack.config.js,内容如下:
export default function(webpackConfig) {
  delete webpackConfig.resolve.alias['@babel/runtime'];
  return webpackConfig;
}
  1. roadhog 依赖使用 ^2.5.0-beta.4

@sydboys
Copy link

sydboys commented Mar 21, 2019

试了 无效 最后这样设置的

export default function(webpackConfig) {
delete webpackConfig.resolve.modules
return webpackConfig;
}

@Linginnn
Copy link

Linginnn commented Mar 26, 2019

让roadhog 依赖使用 ^2.5.0-beta.4 就出现这个了
image

这个原因好像是路由配置那里,引入了history,我是用的antd design pro 第一版

@chaegumi
Copy link

我这样解决的,ant-design/ant-design-pro#3647 (comment)

@wsf1214
Copy link

wsf1214 commented May 5, 2019

原因

history 发布了 4.9,roadhog 之前版本对于 @babel/runtime 的处理不恰当。

方案

试了下,有两个方案供选择,

  1. 新建 webpack.config.js,内容如下:
export default function(webpackConfig) {
  delete webpackConfig.resolve.alias['@babel/runtime'];
  return webpackConfig;
}
  1. roadhog 依赖使用 ^2.5.0-beta.4

两种方法都试了,都没有解决。
第一种:报webpackConfig.resolve 未定义
第二种:cnpm run start之后 没有反应,也没有报错

@BigKongfuPanda
Copy link

我这样解决的,ant-design/ant-design-pro#3647 (comment)

按照你说的解决了。
yarn add dva@2.5.0-beta.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants