taro icon indicating copy to clipboard operation
taro copied to clipboard

微信自定义组件无法正常获取到传递的props参数

Open jijiaxin1808 opened this issue 10 months ago • 0 comments

相关平台

微信小程序

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

复现步骤

重现链接:https://github.com/jijiaxin1808/taro_issue_template

  1. 执行yarn watch:weapp编译项目
  2. 在微信小程序开发者工具中打开

期望结果

  1. 项目正常渲染
  2. 首页中引入的小程序自定义组件可以正常打印出props参数

实际结果

  1. 编译出错,报错error: module 'common.js' is not defined, require args is './common(这里编译出错需要把dist路径下的相关报错文件中的require("../../common");代码注释掉后可正常使用)
  2. 小程序自定义组件中打印props无法正常获取到props

环境信息

  Taro CLI 3.6.26 environment info:
    System:
      OS: macOS 13.4
      Shell: 3.2.57 - /bin/bash
    Binaries:
      Node: 16.20.1 - /usr/local/bin/node
      Yarn: 1.22.19 - /usr/local/bin/yarn
      npm: 8.19.4 - /usr/local/bin/npm
    npmPackages:
      @tarojs/cli: 3.6.25 => 3.6.25 
      @tarojs/components: 3.6.25 => 3.6.25 
      @tarojs/helper: 3.6.25 => 3.6.25 
      @tarojs/plugin-framework-react: 3.6.25 => 3.6.25 
      @tarojs/plugin-platform-alipay: 3.6.25 => 3.6.25 
      @tarojs/plugin-platform-h5: 3.6.25 => 3.6.25 
      @tarojs/plugin-platform-jd: 3.6.25 => 3.6.25 
      @tarojs/plugin-platform-qq: 3.6.25 => 3.6.25 
      @tarojs/plugin-platform-swan: 3.6.25 => 3.6.25 
      @tarojs/plugin-platform-tt: 3.6.25 => 3.6.25 
      @tarojs/plugin-platform-weapp: 3.6.25 => 3.6.25 
      @tarojs/react: 3.6.25 => 3.6.25 
      @tarojs/runtime: 3.6.25 => 3.6.25 
      @tarojs/shared: 3.6.25 => 3.6.25 
      @tarojs/taro: 3.6.25 => 3.6.25 
      @tarojs/taro-loader: 3.6.25 => 3.6.25 
      @tarojs/webpack5-runner: 3.6.25 => 3.6.25 
      babel-preset-taro: 3.6.25 => 3.6.25 
      eslint-config-taro: 3.6.25 => 3.6.25 
      react: ^18.0.0 => 18.2.0

jijiaxin1808 avatar Apr 14 '24 03:04 jijiaxin1808