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

有相关文件却说没有---Module not found: Can't resolve #2155

Closed
lijicheng123 opened this issue Feb 13, 2019 · 4 comments
Closed

有相关文件却说没有---Module not found: Can't resolve #2155

lijicheng123 opened this issue Feb 13, 2019 · 4 comments
Assignees

Comments

@lijicheng123
Copy link

问题描述
用有赞的ui vant-weapp做的微信小程序,想转成h5,在转换的过程中出现了报错:

./.temp/miniprogram_npm/vant-weapp/action-sheet/index.js
Module not found: Can't resolve '../loading/index' in '/Users/lijicheng/work/consumer-mp/miniprogram/taroConvert/.temp/miniprogram_npm/vant-weapp/action-sheet'

这个目录

miniprogram_npm/vant-weapp/

实际上是有loading这个目录的。截图如下:
image

image

转过来的的这个.temp/目录下却没有loading这个文件夹了。不知道是什么原因

复现步骤

  1. taro convert

  2. cd taroConvert

  3. npm install
    4.npm run dev:h5
    然后就报错了

// 代码涉及的有点多,就暂时不复制了

期望行为

希望能把loading这个目录弄过来,不报错
报错信息

`
./.temp/miniprogram_npm/vant-weapp/action-sheet/index.js
Module not found: Can't resolve '../loading/index' in '/Users/lijicheng/work/consumer-mp/miniprogram/taroConvert/.temp/miniprogram_npm/vant-weapp/action-sheet'

`

系统信息

`
➜ ~ taro info
👽 Taro v1.2.12

Taro CLI 1.2.12 environment info:
System:
OS: macOS High Sierra 10.13.6
Shell: 5.3 - /bin/zsh
Binaries:
Node: 11.5.0 - ~/.nvm/versions/node/v11.5.0/bin/node
Yarn: 1.12.3 - ~/.nvm/versions/node/v11.5.0/bin/yarn
npm: 6.5.0 - ~/.nvm/versions/node/v11.5.0/bin/npm
`

  • 报错平台 [h5, weapp]

补充信息
从有赞的ui库上没有发现明显的问题,第一次执行taro convert的时候因为css报错,修改之后我rm -rf taroConvert 了的 应该没有缓存

@taro-bot
Copy link

taro-bot bot commented Feb 13, 2019

欢迎提交 Issue~

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

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

Good luck and happy coding~

@lijicheng123
Copy link
Author

坐等回复

@luckyadam
Copy link
Member

基于 vant-weapp 开发的小程序目前是无法直接使用 Taro 转换成 Taro 应用运行在 H5 的,主要因为 vant-weapp 的组件使用了 behaviors 和 relations 等目前 Taro 暂时转换不了的特性

https://nervjs.github.io/taro/docs/taroize.html#%E4%B8%8D%E6%94%AF%E6%8C%81-relations-%E5%92%8C-behavior

@taro-bot
Copy link

taro-bot bot commented Apr 8, 2019

CC @Littly

@taro-bot taro-bot bot assigned Littly Apr 8, 2019
@Littly Littly closed this as completed Apr 8, 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