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 v1.3.7 使用了Taro.memo 的hooks组件路径错误 #3751

Closed
lbb00 opened this issue Jul 10, 2019 · 11 comments
Closed

Taro v1.3.7 使用了Taro.memo 的hooks组件路径错误 #3751

lbb00 opened this issue Jul 10, 2019 · 11 comments

Comments

@lbb00
Copy link

lbb00 commented Jul 10, 2019

问题描述
组件错误 组件HomeBanner路径错误,请检查!(可能原因是导出的组件名不正确)

心塞!!!
复现步骤

import Taro from '@tarojs/taro'
import { View, Swiper, SwiperItem, Image } from '@tarojs/components'
import './index.scss'

type Props = {
  bannerList: any[]
}

const HomeBanner = ({ bannerList }: Props) => {
  return (
    <Swiper
      className='home-banner'
      autoplay
      circular
      indicatorDots={bannerList.length > 1 ? true : false}
      indicatorColor='rgba(255,255,255,.64)'
      indicatorActiveColor='#fff'
    >
      {bannerList.map(item => (
        <SwiperItem key={item}>
          <View className='home-banner__item'>
            <Image className='home-banner__item__cover' src='' />
          </View>
        </SwiperItem>
      ))}
    </Swiper>
  )
}

HomeBanner.defaultProps = {
  bannerList: []
}

export default Taro.memo(HomeBanner)
@taro-bot
Copy link

taro-bot bot commented Jul 10, 2019

欢迎提交 Issue~

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

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

Good luck and happy coding~

@lbb00
Copy link
Author

lbb00 commented Jul 10, 2019

貌似去掉Taro.memo仍然报组件导出路径问题

@lbb00
Copy link
Author

lbb00 commented Jul 10, 2019

我这可怜的项目是上不了线了,嘤嘤嘤

@lbb00 lbb00 changed the title Taro v1.3.7 使用了Taro.memo 的hooks组件路径错误,请检查! Taro v1.3.7 使用了Taro.memo 的hooks组件路径错误 Jul 10, 2019
@yuche
Copy link
Contributor

yuche commented Jul 10, 2019

之前的版本可以吗

@lbb00
Copy link
Author

lbb00 commented Jul 10, 2019

1.3.5的时候是正常的

@lbb00
Copy link
Author

lbb00 commented Jul 10, 2019

错误 组件错误 组件HomeBanner路径错误,请检查!(可能原因是导出的组件名不正确)
编译 组件文件 src/components/HomeFreeAudioList/index.tsx

@lbb00
Copy link
Author

lbb00 commented Jul 10, 2019

错误 页面编译 页面/Users/onelong/work/ilisten-taro-pack/src/pages/index/index编译失败!
TypeError [ERR_INVALID_ARG_TYPE]: The "to" argument must be of type string. Received type object
at validateString (internal/validators.js:107:11)
at Object.relative (path.js:1052:5)
at /Users/onelong/work/ilisten-taro-pack/node_modules/@tarojs_cli@1.3.7@@tarojs/cli/dist/mini/page.js:179:84
at Array.forEach ()
at /Users/onelong/work/ilisten-taro-pack/node_modules/
@tarojs_cli@1.3.7@@tarojs/cli/dist/mini/page.js:170:47
at Array.forEach ()
at /Users/onelong/work/ilisten-taro-pack/node_modules/@tarojs_cli@1.3.7@@tarojs/cli/dist/mini/page.js:169:54
at Array.forEach ()
at /Users/onelong/work/ilisten-taro-pack/node_modules/
@tarojs_cli@1.3.7@@tarojs/cli/dist/mini/page.js:166:40
at Generator.next ()

@gy18505
Copy link

gy18505 commented Jul 24, 2019

我也遇到同样的问题!路径和代码都没有问题。

@gy18505
Copy link

gy18505 commented Jul 24, 2019

错误 页面编译 页面/Users/onelong/work/ilisten-taro-pack/src/pages/index/index编译失败!
TypeError [ERR_INVALID_ARG_TYPE]: The "to" argument must be of type string. Received type object
at validateString (internal/validators.js:107:11)
at Object.relative (path.js:1052:5)
at /Users/onelong/work/ilisten-taro-pack/node_modules/@tarojs_cli@1.3.7@@tarojs/cli/dist/mini/page.js:179:84 at Array.forEach () at /Users/onelong/work/ilisten-taro-pack/node_modules/@tarojs_cli@1.3.7@@tarojs/cli/dist/mini/page.js:170:47
at Array.forEach ()
at /Users/onelong/work/ilisten-taro-pack/node_modules/@tarojs_cli@1.3.7@@tarojs/cli/dist/mini/page.js:169:54 at Array.forEach () at /Users/onelong/work/ilisten-taro-pack/node_modules/@tarojs_cli@1.3.7@@tarojs/cli/dist/mini/page.js:166:40
at Generator.next ()

这个问题也出现了,请问你的解决了吗?

@gy18505
Copy link

gy18505 commented Jul 24, 2019

我也遇到同样的问题!路径和代码都没有问题。

OS: MacOS version 10.13.6
taro: 1.3.10
editor: VS Code

@lbb00
Copy link
Author

lbb00 commented Jul 24, 2019

@gy18505 你能大概贴一下导出的代码么,我看看

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