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

Taro v3.0.7 build:h5时报错 #7303

Closed
349989153 opened this issue Aug 11, 2020 · 8 comments
Closed

Taro v3.0.7 build:h5时报错 #7303

349989153 opened this issue Aug 11, 2020 · 8 comments
Labels
F-react Framework - React T-h5 Target - 编译到 H5 V-3 Version - 3.x

Comments

@349989153
Copy link

相关平台

H5

浏览器版本: Chrome 版本 84.0.4147.105(正式版本) (64 位)
使用框架: React

复现步骤

原本taro-cli和项目中的taro是v3.0.2版本,运行npm run build:h5正常。

后面为了解决另一个问题,运行以下命令升级到v3.0.7:
sudo taro update self 3.0.7
taro update project 3.0.7

然后在3.0.7环境下打包 npm run build:h5 就报错了:

🙅   Failed to compile.

./src/app.config.js
Module not found: Can't resolve './pages/activityApply/index.config' in '/Users/luyang/workspace/company/new-time-center/src'

而我/pages/activityApply/下有且只有index.jsx,从来没有过index.config,不明白为什么会报这个错。

在v3.0.7下,运行以下命令回退版本:
sudo taro update self 3.0.2
taro update project 3.0.2

回退成功之后,不改变项目中任何文件的情况下,运行npm run build:h5,可以成功build。

我认为这说明v3.0.7打包是有问题的。

期望结果

npm run build:h5成功

实际结果

npm run build:h5报错

🙅   Failed to compile.

./src/app.config.js
Module not found: Can't resolve './pages/activityApply/index.config' in '/Users/luyang/workspace/company/new-time-center/src'

环境信息

  Taro CLI 3.0.7 environment info:
    System:
      OS: macOS 10.14.4
      Shell: 3.2.57 - /bin/bash
    Binaries:
      Node: 12.10.0 - /usr/local/bin/node
      Yarn: 1.13.0 - /usr/local/bin/yarn
      npm: 6.10.3 - /usr/local/bin/npm
    npmPackages:
      @tarojs/components: 3.0.7 => 3.0.7 
      @tarojs/mini-runner: 3.0.7 => 3.0.7 
      @tarojs/react: 3.0.7 => 3.0.7 
      @tarojs/runtime: 3.0.7 => 3.0.7 
      @tarojs/taro: 3.0.7 => 3.0.7 
      @tarojs/webpack-runner: 3.0.7 => 3.0.7 
      babel-preset-taro: 3.0.7 => 3.0.7 
      eslint-config-taro: 3.0.7 => 3.0.7 
      react: ^16.10.0 => 16.13.1 
      taro-ui: ^3.0.0-alpha.3 => 3.0.0-alpha.3 


@taro-bot2 taro-bot2 bot added F-react Framework - React T-h5 Target - 编译到 H5 V-3 Version - 3.x labels Aug 11, 2020
@349989153
Copy link
Author

Taro
附上报错文件的截图,没看出来为什么报错了

@349989153
Copy link
Author

我的repo是github上私有repo,麻烦需要代码的同学加我qq,谢谢

@349989153
Copy link
Author

3.0.2 h5.router.mode = hash取不到参数,h5.router.mode = browser报Route not found

3.0.7 build报错不知道哪里有问题

救救孩子吧

@349989153
Copy link
Author

ok,每个页面下都加上对应都xxxx.config.js就可以了

@paulloo
Copy link

paulloo commented Aug 18, 2020

3.0.2 h5.router.mode = hash取不到参数,h5.router.mode = browser报Route not found

3.0.7 build报错不知道哪里有问题

救救孩子吧

正解,3.0.7 包这个错也是h5.router.mode 取不到参数的原因

@konglx90
Copy link

ok,每个页面下都加上对应都xxxx.config.js就可以了

为什么要强制加呢

@349989153
Copy link
Author

@konglx90 我不知道,3.0.2的时候还不会报错的,升级之后就这样了。

@ndaybreak
Copy link

@konglx90 这个问题有解决吗

@ZakaryCode ZakaryCode moved this to Done in H5 Apr 10, 2023
@ZakaryCode ZakaryCode added this to H5 Apr 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
F-react Framework - React T-h5 Target - 编译到 H5 V-3 Version - 3.x
Projects
Archived in project
Development

No branches or pull requests

4 participants