taro icon indicating copy to clipboard operation
taro copied to clipboard

使用linaria会报错,Using the "styled" tag in runtime is not supported.

Open anyone0034 opened this issue 11 months ago • 5 comments

相关平台

字节跳动小程序

小程序基础库: 3.16.0 使用框架: React

复现步骤

这个问题很奇怪,我之前也遇到过,但是通过删除node_modules,重新执行yarn,或者重启小程序开发者工具,就好了。这次怎么操作,都不行,我自己新建项目也是报这个错误,使用官方提供的example,也是报同样的错误:https://github.com/sonofmagic/weapp-pandacss/tree/main/examples/taro-app-linaria

期望结果

使用linaria能正常运行

实际结果

无法使用linaria会报错Using the "styled" tag in runtime is not supported. Make sure you have set up the Babel plugin correctly. See https://github.com/callstack/linaria#setup,如果不使用linaria就能正常运行。

环境信息

👽 Taro v3.6.25


  Taro CLI 3.6.25 environment info:
    System:
      OS: Windows 10 10.0.19045
    Binaries:
      Node: 20.10.0 - E:\_app\dev\nodejs\node.EXE
      Yarn: 4.1.1 - ~\AppData\Roaming\npm\yarn.CMD
      npm: 10.5.0 - E:\_app\dev\nodejs\npm.CMD
    npmPackages:
      @tarojs/cli: 3.6.22 => 3.6.22
      @tarojs/components: 3.6.22 => 3.6.22
      @tarojs/helper: 3.6.22 => 3.6.22
      @tarojs/plugin-framework-react: 3.6.22 => 3.6.22
      @tarojs/plugin-platform-alipay: 3.6.22 => 3.6.22
      @tarojs/plugin-platform-h5: 3.6.22 => 3.6.22
      @tarojs/plugin-platform-jd: 3.6.22 => 3.6.22
      @tarojs/plugin-platform-qq: 3.6.22 => 3.6.22
      @tarojs/plugin-platform-swan: 3.6.22 => 3.6.22
      @tarojs/plugin-platform-tt: 3.6.22 => 3.6.22
      @tarojs/plugin-platform-weapp: 3.6.22 => 3.6.22
      @tarojs/react: 3.6.22 => 3.6.22
      @tarojs/runtime: 3.6.22 => 3.6.22
      @tarojs/shared: 3.6.22 => 3.6.22
      @tarojs/taro: 3.6.22 => 3.6.22
      @tarojs/taro-loader: 3.6.22 => 3.6.22
      @tarojs/webpack5-runner: 3.6.22 => 3.6.22
      babel-preset-taro: 3.6.22 => 3.6.22
      eslint-config-taro: 3.6.22 => 3.6.22
      react: ^18.0.0 => 18.2.0
      

anyone0034 avatar Mar 28 '24 20:03 anyone0034

这个是你的linaria的loader没配置好或者linaria的loader版本跟@linaria/core版本不匹配。比如你的loader是6.x.x,你的core是5.x.x

SexySix avatar Apr 25 '24 06:04 SexySix

这个是你的linaria的loader没配置好或者linaria的loader版本跟@linaria/core版本不匹配。比如你的loader是6.x.x,你的core是5.x.x

image 这样也运行不了啊

Aristodemusa avatar May 16 '24 07:05 Aristodemusa

这个是你的linaria的loader没配置好或者linaria的loader版本跟@linaria/core版本不匹配。比如你的loader是6.x.x,你的core是5.x.x

image 这样也运行不了啊

https://juejin.cn/post/7369443731727679526 可以参考我这篇文章去做配置

SexySix avatar May 16 '24 07:05 SexySix

最终这个问题能解决嘛?

fengxiaotx avatar Aug 19 '24 02:08 fengxiaotx