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

按照多端组件命名规则创建xxx.js和xxx.rn.js,微信小程序中编译生成的是xxx.rn.js而不是xxx.js;rn编译生成xxx.rn.js和xxx.js #2680

Closed
gzqreder opened this issue Apr 4, 2019 · 7 comments

Comments

@gzqreder
Copy link

gzqreder commented Apr 4, 2019

问题描述
根据官方文档跨平台开发部分:https://nervjs.github.io/taro/docs/envs.html
按照多端组件命名规则创建xxx.js和xxx.rn.js。
微信小程序中编译生成的是xxx.rn.js而不是xxx.js,xxx.rn.js中如果引入rn特有的模块会报错
rn编译生成xxx.rn.js和xxx.js,使用能够正确引用xxx.rn.js

复现步骤

[或者可以直接贴源代码,能贴文字就不要截图]

// 这里可以贴代码

期望行为
能够正确引用期望的文件,小程序引用xxx.js,rn引用xxx.rn.js

报错信息

[这里请贴上你的完整报错截图或文字]

系统信息

Taro v1.2 及以上版本已添加 taro info 命令,方便大家查看系统及依赖信息,运行该命令后将结果贴下面即可。

  • 操作系统: [mac]
  • Taro 版本 [1.2.22]
  • Node.js 版本 [e.g. v9.0.0]
  • 报错平台 [rn, weapp]

补充信息
[可选]
[根据你的调查研究,出现这个问题的原因可能在哪里?]

@taro-bot
Copy link

taro-bot bot commented Apr 4, 2019

欢迎提交 Issue~

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

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

Good luck and happy coding~

@luckyadam
Copy link
Member

没有复现啊,可以提供一个 demo 么

@taro-bot
Copy link

taro-bot bot commented Apr 4, 2019

Hello~

您的问题我们无法复现。如果有空的话还请拔冗提供一个简单的复现 demo,否则这个 issue 将在 15 天后被自动关闭。

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

Good luck and happy coding~

@gzqreder
Copy link
Author

gzqreder commented Apr 4, 2019

taro cli是1.2.22,项目是1.2.21
Taro CLI 1.2.22 environment info:
System:
OS: macOS 10.14.4
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 11.9.0 - /usr/local/bin/node
Yarn: 1.7.0 - ~/.yarn/bin/yarn
npm: 6.9.0 - /usr/local/bin/npm
npmPackages:
@tarojs/components: 1.2.21 => 1.2.21
@tarojs/mobx: 1.2.21 => 1.2.21
@tarojs/mobx-h5: 1.2.21 => 1.2.21
@tarojs/mobx-rn: 1.2.21 => 1.2.21
@tarojs/plugin-babel: 1.2.21 => 1.2.21
@tarojs/plugin-csso: 1.2.21 => 1.2.21
@tarojs/plugin-sass: ^1.2.22 => 1.2.22
@tarojs/plugin-uglifyjs: 1.2.21 => 1.2.21
@tarojs/rn-runner: 1.2.21 => 1.2.21
@tarojs/router: 1.2.21 => 1.2.21
@tarojs/taro: 1.2.21 => 1.2.21
@tarojs/taro-alipay: 1.2.21 => 1.2.21
@tarojs/taro-h5: 1.2.21 => 1.2.21
@tarojs/taro-swan: 1.2.21 => 1.2.21
@tarojs/taro-tt: 1.2.21 => 1.2.21
@tarojs/taro-weapp: 1.2.21 => 1.2.21
@tarojs/webpack-runner: 1.2.21 => 1.2.21
eslint-config-taro: 1.2.21 => 1.2.21
eslint-plugin-taro: 1.2.21 => 1.2.21
nervjs: ^1.3.9 => 1.3.13
stylelint-taro-rn: ^1.2.21 => 1.2.21
npmGlobalPackages:
typescript: 3.4.1
由于1.2.22上rn有另外一个问题 #2626
项目没有升级
我创建一个全新的1.2.22的项目,小程序部分是能正确生成的

@luckyadam
Copy link
Member

@gzqreder 那是 RN 端存在问题?

@Pines-Cheng
Copy link
Contributor

贴一下代码和文件结构?

@gzqreder
Copy link
Author

gzqreder commented Apr 9, 2019

先关闭吧,cli升级到1.2.23后,rn和小程序都能正常生成了。如果再发现,我再提issue

@gzqreder gzqreder closed this as completed Apr 9, 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