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

字节跳动小程序引入原生组件ttss文件编译报错 #6242

Closed
55utah opened this issue May 7, 2020 · 5 comments
Closed

字节跳动小程序引入原生组件ttss文件编译报错 #6242

55utah opened this issue May 7, 2020 · 5 comments
Assignees

Comments

@55utah
Copy link

55utah commented May 7, 2020

问题描述

基于Taro 开发字节跳动小程序,根据文档 使用第三方原生组件 引入原生组件,在Taro 1.3.4版本时,代码可正常编译运行,Taro升级到2.2.3之后编译报错,ttss文件无法编译:报错信息如下:
Module parse failed: Unexpected token (1:0) You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders

复现步骤

在Taro 2.2.3 版本下,完成原生组件,具有ttml, ttss等文件,被Taro组件引用后,加入测试页面,最后进行编译运行;
(测试发现wxml, wxss在微信编译模式下可以编译,但是ttss文件无法在字节跳动编译模式下编译,ttml文件可以编译,所以认为是bug)

import Taro from '@tarojs/taro';

function Test({}) {

    const chooseReaction = () => {
        console.warn(1)
    }

    return <reaction-panel
        onreactiontap={chooseReaction}
    ></reaction-panel>
}

Test.config = {
    usingComponents: {
        'reaction-panel':
            '../reaction_panel/index',
    },
};

export default Test

image

期望行为

期望可以正常编译原生组件的ttss文件。

报错信息

image

系统信息

`👽 Taro v2.2.3

Taro CLI 2.2.3 environment info:
System:
OS: macOS 10.14.6
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 12.13.1 - /usr/local/bin/node
Yarn: 1.21.1 - /usr/local/bin/yarn
npm: 6.13.4 - /usr/local/bin/npm
npmPackages:
@tarojs/components: 2.2.3 => 2.2.3
@tarojs/components-qa: 2.2.3 => 2.2.3
@tarojs/mini-runner: 2.2.3 => 2.2.3
@tarojs/redux: 2.2.3 => 2.2.3
@tarojs/redux-h5: 2.2.3 => 2.2.3
@tarojs/router: 2.2.3 => 2.2.3
@tarojs/taro: 2.2.3 => 2.2.3
@tarojs/taro-alipay: 2.2.3 => 2.2.3
@tarojs/taro-h5: 2.2.3 => 2.2.3
@tarojs/taro-qq: 2.2.3 => 2.2.3
@tarojs/taro-quickapp: 2.2.3 => 2.2.3
@tarojs/taro-swan: 2.2.3 => 2.2.3
@tarojs/taro-tt: 2.2.3 => 2.2.3
@tarojs/taro-weapp: 2.2.3 => 2.2.3
@tarojs/webpack-runner: 2.2.3 => 2.2.3
eslint-config-taro: 2.2.3 => 2.2.3
eslint-plugin-taro: 2.2.3 => 2.2.3
nerv-devtools: ^1.5.5 => 1.5.6
nervjs: ^1.5.5 => 1.5.6
stylelint-config-taro-rn: 2.2.3 => 2.2.3
stylelint-taro-rn: 2.2.3 => 2.2.3 `

补充信息

@taro-bot
Copy link

taro-bot bot commented May 7, 2020

CC @Chen-jj

@taro-bot
Copy link

taro-bot bot commented May 7, 2020

欢迎提交 Issue~

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

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

Good luck and happy coding~

@taro-bot
Copy link

taro-bot bot commented May 10, 2020

CC @luckyadam

@scarcoco
Copy link

这个咋解决呢? @55utah

@55utah
Copy link
Author

55utah commented May 11, 2020

这个咋解决呢? @55utah

还没有解决,所以提了bug, 一直没有回复我。。

luckyadam added a commit that referenced this issue May 13, 2020
## 特性
- 添加 mdns 相关 api,close #6258

## 修复
- 修复使用 sass 打包项目时多端样式失效的问题,close #6218 
- 修复 css-loader 升级到 3.0.0 后带来 breaking change 问题,close #6191
- 修复对头条、京东小程序的原生样式编译的支持,close #6242
- 修复 service 和 helper 类型缺失问题
- 修复 H5 tabbar 跳转问题
- 修复 App 的 config 为静态属性时获取不到 config 对象的问题
- 修复 modifyWebpackChain 可能失效的问题
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

4 participants