We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
H5
浏览器版本: Chrome 99.0.4844.51(正式版本) (x86_64) 使用框架: React
安装依赖 cnpm i 运行命令 npm run dev:h5
编译正常
Failed to compile.
./src/pages/index/index.jsx Module not found: Can't resolve '@tarojs/taro/html.css' in '/Users/jiangxin/test_project/taro/taro_demo1/src/pages/index'
Taro v3.4.0 Taro CLI 3.4.0 environment info: System: OS: macOS 12.2.1 Shell: 5.8 - /bin/zsh Binaries: Node: 14.16.1 - ~/.nvm/versions/node/v14.16.1/bin/node Yarn: 1.22.11 - ~/.nvm/versions/node/v14.16.1/bin/yarn npm: 6.14.12 - ~/.nvm/versions/node/v14.16.1/bin/npm npmPackages: @tarojs/cli: 3.4.0 => 3.4.0 @tarojs/components: 3.4.0 => 3.4.0 @tarojs/mini-runner: 3.4.0 => 3.4.0 @tarojs/react: 3.4.0 => 3.4.0 @tarojs/runtime: 3.4.0 => 3.4.0 @tarojs/taro: 3.4.0 => 3.4.0 @tarojs/webpack-runner: 3.4.0 => 3.4.0 babel-preset-taro: 3.4.0 => 3.4.0 eslint-config-taro: 3.4.0 => 3.4.0 react: ^17.0.2 => 17.0.2 taro-ui: ^3.0.0-alpha.3 => 3.0.0-alpha.10 npmGlobalPackages: typescript: 4.2.4
The text was updated successfully, but these errors were encountered:
等待热心的小伙伴解决问题中..., 有一些相关的 issues 可能帮助到你!
Thank you so much!
Sorry, something went wrong.
duplicate #11390
@soeasyjx 使用 require 代替 import 引入咯,在 H5 不需要这个样式文件。
if (process.env.TARO_ENV !== 'h5') { require('@tarojs/taro/html.css') }
No branches or pull requests
相关平台
H5
浏览器版本: Chrome 99.0.4844.51(正式版本) (x86_64)
使用框架: React
复现步骤
安装依赖 cnpm i
运行命令 npm run dev:h5
期望结果
编译正常
实际结果
Failed to compile.
./src/pages/index/index.jsx
Module not found: Can't resolve '@tarojs/taro/html.css' in '/Users/jiangxin/test_project/taro/taro_demo1/src/pages/index'
环境信息
The text was updated successfully, but these errors were encountered: