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

路由设置编译成多页应用的时候,useState初始化为一个Obj,报错。 #14178

Closed
AaronDaiR opened this issue Jul 14, 2023 · 2 comments
Labels
F-react Framework - React question Further information is requested T-h5 Target - 编译到 H5 to be closed V-3 Version - 3.x

Comments

@AaronDaiR
Copy link

相关平台

H5

浏览器版本: Chrome 62、Safari 10
使用框架: React

复现步骤

route设置成多页,然后在页面实例中导入一个import { 值为对象 } from 'utils'
utils里 export { name:'xxx' }
就报错

期望结果

不报错,拿到正确的导入导出值

实际结果

报错,报undefined不能in循环

环境信息

Taro CLI 3.6.5-alpha environment info:
    System:
      OS: macOS 12.4
      Shell: 5.8.1 - /bin/zsh
    Binaries:
      Node: 16.17.0 - ~/.nvm/versions/node/v16.17.0/bin/node
      Yarn: 1.22.19 - ~/.nvm/versions/node/v16.17.0/bin/yarn
      npm: 9.6.5 - ~/.nvm/versions/node/v16.17.0/bin/npm
    npmPackages:
      @tarojs/cli: 3.6.8 => 3.6.8 
      @tarojs/components: 3.6.8 => 3.6.8 
      @tarojs/helper: 3.6.8 => 3.6.8 
      @tarojs/plugin-framework-react: 3.6.8 => 3.6.8 
      @tarojs/plugin-html: 3.6.8 => 3.6.8 
      @tarojs/plugin-mini-ci: 3.6.8 => 3.6.8 
      @tarojs/plugin-platform-alipay: 3.6.8 => 3.6.8 
      @tarojs/plugin-platform-h5: 3.6.8 => 3.6.8 
      @tarojs/plugin-platform-weapp: 3.6.8 => 3.6.8 
      @tarojs/react: 3.6.8 => 3.6.8 
      @tarojs/runtime: 3.6.8 => 3.6.8 
      @tarojs/shared: 3.6.8 => 3.6.8 
      @tarojs/taro: 3.6.8 => 3.6.8 
      @tarojs/webpack5-runner: 3.6.8 => 3.6.8 
      babel-preset-taro: 3.6.8 => 3.6.8 
      react: ^18.0.0 => 18.2.0 


补充信息

对于多页面应用,有点着急,希望老板3.6.9能发

@taro-bot2 taro-bot2 bot added F-react Framework - React T-h5 Target - 编译到 H5 V-3 Version - 3.x labels Jul 14, 2023
@github-project-automation github-project-automation bot moved this to Padding in H5 Jul 14, 2023
@AaronDaiR
Copy link
Author

image
感觉在编译那层 export导出对象之后 ,import导入进来 就报错了

@ZakaryCode
Copy link
Contributor

未能复现相关问题

@ZakaryCode ZakaryCode added question Further information is requested to be closed labels Aug 1, 2023
@github-project-automation github-project-automation bot moved this from Padding to Done in H5 Aug 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
F-react Framework - React question Further information is requested T-h5 Target - 编译到 H5 to be closed V-3 Version - 3.x
Projects
Archived in project
Development

No branches or pull requests

2 participants