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

[beta2.0.0-beta.8]h5 编译失败,编译后import Taro, { Component } from "@tarojs/taro-h5"; 缺少Config。代码里:import Taro, { Component, Config } from '@tarojs/taro' #5119

Closed
youyou0101 opened this issue Dec 18, 2019 · 15 comments
Assignees
Milestone

Comments

@youyou0101
Copy link

问题描述

h5编译失败,读取不到app.tsx 的config信息。小程序编译正常。

复现步骤

  1. 运行命令:npm run dev

期望行为

运行成功

报错信息

./.temp/app.js
Module build failed (from ./node_modules/babel-loader/lib/index.js):
SyntaxError: Unexpected token (387:9)

  385 |         </Provider>;
  386 |   }
> 387 |   config = {
      |          ^
  388 |     pages: ["/pages/index/index", "/pages/pick_city/index", "/pages/login_by_phone/index", "/pages/user/user_setting/index", "/pages/login/index", "/pages/show_pdf/index", "/pages/mine_book/index", "/pages/user/user_authentication/index", "/pages/user/user_data_edit/index", "/pages/user/user_edit/index", "/pages/house_detail/index", "/pages/book_room/index", "/pages/book_success/index", "/pages/store/detail/index", "/pages/house_detail_building/index"],
  389 |     window: {
  390 |       backgroundTextStyle: 'light',
@taro-bot
Copy link

taro-bot bot commented Dec 18, 2019

CC @Littly

@taro-bot
Copy link

taro-bot bot commented Dec 18, 2019

欢迎提交 Issue~

如果你提交的是 bug 报告,请务必遵循 Issue 模板的规范,尽量用简洁的语言描述你的问题,最好能提供一个稳定简单的复现。🙏🙏🙏

如果你的信息提供过于模糊或不足,或者已经其他 issue 已经存在相关内容,你的 issue 有可能会被关闭。

Good luck and happy coding~

@youyou0101
Copy link
Author

taro 版本 2.0.0-beta.8

@youyou0101
Copy link
Author

编译后import Taro, { Component } from "@tarojs/taro-h5"; 缺少Config。代码里:import Taro, { Component, Config } from '@tarojs/taro'

@Garfield550 Garfield550 added this to the 2.0.0-beta.9 milestone Dec 18, 2019
@youyou0101
Copy link
Author

更新到1.3.30好了。

@shenghanqin shenghanqin changed the title h5 编译失败 [beta2.0.0-beta.8]h5 编译失败,编译后import Taro, { Component } from "@tarojs/taro-h5"; 缺少Config。代码里:import Taro, { Component, Config } from '@tarojs/taro' Dec 20, 2019
@youyou0101
Copy link
Author

Taro CLI 1.3.19 environment info:
System:
OS: macOS High Sierra 10.13.6
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 13.1.0 - /usr/local/bin/node
Yarn: 1.12.3 - /usr/local/bin/yarn
npm: 6.11.3 - /usr/local/bin/npm
npmPackages:
@tarojs/async-await: 2.0.0-beta.9 => 2.0.0-beta.9
@tarojs/components: 2.0.0-beta.9 => 2.0.0-beta.9
@tarojs/mobx: 2.0.0-beta.9 => 2.0.0-beta.9
@tarojs/mobx-h5: 2.0.0-beta.9 => 2.0.0-beta.9
@tarojs/mobx-rn: 2.0.0-beta.9 => 2.0.0-beta.9
@tarojs/plugin-babel: 2.0.0-beta.9 => 2.0.0-beta.9
@tarojs/plugin-csso: 2.0.0-beta.9 => 2.0.0-beta.9
@tarojs/plugin-sass: 2.0.0-beta.9 => 2.0.0-beta.9
@tarojs/plugin-uglifyjs: 2.0.0-beta.9 => 2.0.0-beta.9
@tarojs/rn-runner: 2.0.0-beta.9 => 2.0.0-beta.9
@tarojs/router: 2.0.0-beta.9 => 2.0.0-beta.9
@tarojs/taro: 2.0.0-beta.9 => 2.0.0-beta.9
@tarojs/taro-alipay: 2.0.0-beta.9 => 2.0.0-beta.9
@tarojs/taro-h5: 2.0.0-beta.9 => 2.0.0-beta.9
@tarojs/taro-swan: 2.0.0-beta.9 => 2.0.0-beta.9
@tarojs/taro-tt: 2.0.0-beta.9 => 2.0.0-beta.9
@tarojs/taro-weapp: ^2.0.0-beta.9 => 2.0.0-beta.9
@tarojs/webpack-runner: 2.0.0-beta.9 => 2.0.0-beta.9
eslint-config-taro: 2.0.0-beta.9 => 2.0.0-beta.9
eslint-plugin-taro: 2.0.0-beta.9 => 2.0.0-beta.9
nerv-devtools: ^1.5.6 => 1.5.6
nervjs: ^1.5.6 => 1.5.6
stylelint-config-taro-rn: 2.0.0-beta.9 => 2.0.0-beta.9
stylelint-taro-rn: 2.0.0-beta.9 => 2.0.0-beta.9

@youyou0101
Copy link
Author

33333

@shenghanqin
Copy link
Collaborator

cli还是老版本?1.3.19?cli与业务版本要一致。

Taro CLI 1.3.19 environment info:
System:
OS: macOS High Sierra 10.13.6
Shell: 3.2.57 - /bin/ba

@youyou0101
Copy link
Author

👽 Taro v2.0.0-beta.9

debug node_env development
debug base_url localhost
debug node_env development

还是不行

@youyou0101
Copy link
Author

升级后 alias 失效。🙅 编译失败.

./src/pages/login/index.tsx
Module not found: Can't resolve '@/apis/api-login' in '/Users/wsl/Documents/aster-reborn/src/pages/login'

@youyou0101
Copy link
Author

回退到1.3.30 h5,微信小程序都 编译成功。

@Garfield550
Copy link
Collaborator

beta 现在还有些问题,会在近期修复。

@youyou0101
Copy link
Author

好滴好滴

@taro-bot
Copy link

taro-bot bot commented Dec 27, 2019

Hello~

您的问题楼上已经有了确切的回答,如果没有更多的问题这个 issue 将在 15 天后被自动关闭。

如果您在这 15 天中更新更多信息自动关闭的流程会自动取消,如有其他问题也可以发起新的 Issue。

Good luck and happy coding~

@taro-bot taro-bot bot removed the to be closed label Jan 11, 2020
@taro-bot taro-bot bot closed this as completed Jan 11, 2020
@novenn
Copy link

novenn commented Sep 15, 2020

这个问题2.0.7版本还是不行啊
现在最新都到3了
请问怎么解决

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

5 participants