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

dangerouslySetInnerHTML 无法渲染内容 #17079

Closed
Yang03 opened this issue Dec 25, 2024 · 1 comment
Closed

dangerouslySetInnerHTML 无法渲染内容 #17079

Yang03 opened this issue Dec 25, 2024 · 1 comment

Comments

@Yang03
Copy link
Contributor

Yang03 commented Dec 25, 2024

相关平台

微信小程序

复现仓库

https://github.com/Yang03/taro-demo.git
小程序基础库: 3.0.0
使用框架: React

复现步骤

运行npm run build:weapp

页面使用 dangerouslySetInnerHTML 渲染的内容,没有出现

期望结果

希望渲染出 html 里面的内容

实际结果

空节点

环境信息

👽 Taro v4.0.8


  Taro CLI 4.0.8 environment info:
    System:
      OS: macOS 14.3.1
      Shell: 5.9 - /bin/zsh
    Binaries:
      Node: 18.20.4 - ~/.nvm/versions/node/v18.20.4/bin/node
      npm: 10.7.0 - ~/.nvm/versions/node/v18.20.4/bin/npm
    npmPackages:
      @tarojs/cli: 4.0.8 => 4.0.8 
      @tarojs/components: 4.0.8 => 4.0.8 
      @tarojs/helper: 4.0.8 => 4.0.8 
      @tarojs/plugin-framework-react: 4.0.8 => 4.0.8 
      @tarojs/plugin-platform-alipay: 4.0.8 => 4.0.8 
      @tarojs/plugin-platform-h5: 4.0.8 => 4.0.8 
      @tarojs/plugin-platform-harmony-hybrid: 4.0.8 => 4.0.8 
      @tarojs/plugin-platform-jd: 4.0.8 => 4.0.8 
      @tarojs/plugin-platform-qq: 4.0.8 => 4.0.8 
      @tarojs/plugin-platform-swan: 4.0.8 => 4.0.8 
      @tarojs/plugin-platform-tt: 4.0.8 => 4.0.8 
      @tarojs/plugin-platform-weapp: 4.0.8 => 4.0.8 
      @tarojs/react: 4.0.8 => 4.0.8 
      @tarojs/runtime: 4.0.8 => 4.0.8 
      @tarojs/shared: 4.0.8 => 4.0.8 
      @tarojs/taro: 4.0.8 => 4.0.8 
      @tarojs/taro-loader: 4.0.8 => 4.0.8 
      @tarojs/webpack5-runner: 4.0.8 => 4.0.8 
      babel-preset-taro: 4.0.8 => 4.0.8 
      eslint-config-taro: 4.0.8 => 4.0.8 
      react: ^18.0.0 => 18.3.1 

补充信息

运行npm run dev:weapp  的结果可以
但是 build 的结果不行

@Yang03
Copy link
Contributor Author

Yang03 commented Dec 25, 2024

@tarojs/runtime': require.resolve('@tarojs/runtime')

@Yang03 Yang03 closed this as completed Dec 25, 2024
This was referenced Dec 28, 2024
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

1 participant