taro react-native模版上使用tailwindcss失败:样式文件没有找到,请检查文件路径: tailwindcss/base

niknxzdl  于 4个月前  发布在  React
关注(0)|答案(2)|浏览(89)

相关平台

React Native

复现仓库

https://github.com/86chenjie/taro-tailwindcss-rn-issue.git

使用框架: React

复现步骤

  1. git clone https://github.com/86chenjie/taro-tailwindcss-rn-issue.git
  2. yarn
  3. yarn start

期望结果

rn中能正常使用tailwindcss

实际结果

用taro playround测试出现错误
Reloading app...
BUNDLE ./index

error: src/app.scss:
样式文件没有找到,请检查文件路径: tailwindcss/base
在 [
/Users/jeff/Workspace/family/family-mono/apps/oneapp/src/node_modules,
/Users/jeff/Workspace/family/family-mono/apps/oneapp/node_modules,
/Users/jeff/Workspace/family/family-mono/apps/node_modules,
/Users/jeff/Workspace/family/family-mono/node_modules,
/Users/jeff/Workspace/family/node_modules,
/Users/jeff/Workspace/node_modules,
/Users/jeff/node_modules,
/Users/node_modules,
/node_modules
]


2 │ @import 'tailwindcss/base';
│ ^^^^^^^^^^^^^^^^^^

stdin 2:9 root stylesheet

环境信息

Taro v3.5.7

  Taro CLI 3.5.7 environment info:
    System:
      OS: macOS 13.5.1
      Shell: 5.9 - /bin/zsh
    Binaries:
      Node: 18.19.0 - ~/.nvm/versions/node/v18.19.0/bin/node
      Yarn: 1.22.19 - ~/.yarn/bin/yarn
      npm: 10.2.3 - ~/.nvm/versions/node/v18.19.0/bin/npm
    npmPackages:
      @tarojs/cli: 3.5.7 => 3.5.7 
      @tarojs/components: 3.5.7 => 3.5.7 
      @tarojs/helper: 3.5.7 => 3.5.7 
      @tarojs/plugin-framework-react: 3.5.7 => 3.5.7 
      @tarojs/plugin-platform-alipay: 3.5.7 => 3.5.7 
      @tarojs/plugin-platform-jd: 3.5.7 => 3.5.7 
      @tarojs/plugin-platform-qq: 3.5.7 => 3.5.7 
      @tarojs/plugin-platform-swan: 3.5.7 => 3.5.7 
      @tarojs/plugin-platform-tt: 3.5.7 => 3.5.7 
      @tarojs/plugin-platform-weapp: 3.5.7 => 3.5.7 
      @tarojs/react: 3.5.7 => 3.5.7 
      @tarojs/rn-runner: 3.5.7 => 3.5.7 
      @tarojs/router: 3.5.7 => 3.5.7 
      @tarojs/runtime: 3.5.7 => 3.5.7 
      @tarojs/shared: 3.5.7 => 3.5.7 
      @tarojs/taro: 3.5.7 => 3.5.7 
      @tarojs/taro-h5: 3.5.7 => 3.5.7 
      @tarojs/taro-rn: 3.5.7 => 3.5.7 
      @tarojs/webpack5-runner: 3.5.7 => 3.5.7 
      babel-preset-taro: 3.5.7 => 3.5.7 
      eslint-config-taro: 3.5.7 => 3.5.7 
      expo: ~46.0.1 => 46.0.21 
      react: ^18.0.0 => 18.2.0 
      react-native: ^0.69.3 => 0.69.12

相关问题