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

H5下编译报错: Cannot read property 'referencePaths' of undefined #4024

Closed
MatthewWu5 opened this issue Jul 31, 2019 · 4 comments
Closed
Assignees

Comments

@MatthewWu5
Copy link

问题描述
给Taro页面组件提供自定义基类时(基类继承Taro.component) 编译H5报错

复现步骤
代码如下

// page
export class TagSearch extends Connected<Props, State> {
// base class
export class Connected<Props = {}, State = {}> extends TaroComponent<
  Props & Store,
  State
> {
  constructor(props?: any) {
    super(props)
  }
}

编译h5报错 但编译weapp时没有问题
Cannot read property 'referencePaths' of undefined
at Array.forEach ()

重现repo https://github.com/p-lay/play-mp/tree/issue/h5
yarn h5即可重现

期望行为
编译通过

报错信息
./.temp/util/component.js
Module build failed (from ./node_modules/babel-loader/lib/index.js):
TypeError: /Users//Documents/Code/justPlay/play-mp/.temp/util/component.js: Cannot read property 'referencePaths' of undefined
at Array.forEach ()

系统信息

  • 操作系统: mac
  • Taro 版本 1.3.5
  • CLI 1.3.11
  • Node.js 版本 v10.9.0
  • 报错平台 h5

补充信息
当尝试将Connect重命名为Component时 编译变为warning
./.temp/components/tagSearch/index.js 159:2-11
" '../../util/component' does not contain an export named 'Component'.

但打开页面时找不到对应的基类
chrome devtool debug发现superClass为undefined

image

@taro-bot
Copy link

taro-bot bot commented Jul 31, 2019

欢迎提交 Issue~

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

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

Good luck and happy coding~

@luckyadam luckyadam added the H5 label Aug 1, 2019
@taro-bot taro-bot bot assigned Littly Aug 1, 2019
@taro-bot
Copy link

taro-bot bot commented Aug 1, 2019

CC @Littly

@Littly
Copy link
Contributor

Littly commented Aug 5, 2019

确实有点小问题 下个版本修复。暂时而言,可以把@tarojs/taro-h5的重命名去掉来规避这个问题。 
image

@MatthewWu5
Copy link
Author

多谢多谢~

@Littly Littly closed this as completed in 6e7f2ab Aug 5, 2019
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

3 participants