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

prebundle会造成vue3实例化2次,导致应用报 Missing ref owner #12340

Closed
agileago opened this issue Aug 21, 2022 · 5 comments · Fixed by #12362
Closed

prebundle会造成vue3实例化2次,导致应用报 Missing ref owner #12340

agileago opened this issue Aug 21, 2022 · 5 comments · Fixed by #12362
Labels
F-vue3 Framework - Vue 3 T-h5 Target - 编译到 H5 V-3 Version - 3.x

Comments

@agileago
Copy link
Collaborator

相关平台

微信小程序

复现仓库

https://github.com/vue3-oop/taro-plugin
小程序基础库: 2
使用框架: Vue 3

复现步骤

pnpm i
进入 playground 里面运行 dev:h5
可在配置里面修改 prebundle的值,观察页面报错

期望结果

打开prebundle正常

实际结果

错误

环境信息

Taro CLI 3.5.3 environment info:
    System:
      OS: macOS 12.5.1
      Shell: 5.8.1 - /bin/zsh
    Binaries:
      Node: 16.16.0 - ~/Library/pnpm/node
      Yarn: 1.22.10 - /opt/homebrew/bin/yarn
      npm: 8.11.0 - ~/Library/pnpm/npm
    npmPackages:
      @tarojs/cli: 3.5.3 => 3.5.3 
      @tarojs/components: 3.5.3 => 3.5.3 
      @tarojs/helper: 3.5.3 => 3.5.3 
      @tarojs/plugin-framework-vue3: 3.5.3 => 3.5.3 
      @tarojs/plugin-html: 3.5.3 => 3.5.3 
      @tarojs/plugin-platform-weapp: 3.5.3 => 3.5.3 
      @tarojs/router: 3.5.3 => 3.5.3 
      @tarojs/runtime: 3.5.3 => 3.5.3 
      @tarojs/shared: 3.5.3 => 3.5.3 
      @tarojs/taro: 3.5.3 => 3.5.3 
      @tarojs/taro-h5: 3.5.3 => 3.5.3 
      @tarojs/webpack5-runner: 3.5.3 => 3.5.3 
      babel-preset-taro: 3.5.3 => 3.5.3 
      eslint-config-taro: 3.5.3 => 3.5.3 

@taro-bot2 taro-bot2 bot added F-vue3 Framework - Vue 3 T-weapp Target - 编译到微信小程序 V-3 Version - 3.x labels Aug 21, 2022
@agileago
Copy link
Collaborator Author

vuejs/core#3930

@ZakaryCode ZakaryCode added T-h5 Target - 编译到 H5 and removed T-weapp Target - 编译到微信小程序 labels Aug 22, 2022
@ZakaryCode
Copy link
Contributor

prebundle 特性并不会多次引入 vue 导致应用多次实例化

同时提供示例并不能正常复现问题,可以提供最简复现作证

@ZakaryCode ZakaryCode added question Further information is requested to be closed labels Aug 22, 2022
@agileago
Copy link
Collaborator Author

@ZakaryCode https://github.com/agileago/taro-bug

顺便提一下, vue3的tsx类型定义文件是错的

export type VueComponentType<P = Record<string, never>> = Component<TransformReact2VueType<P>>

@ZakaryCode
Copy link
Contributor

下一个版本修复,当前可以参考下面配置修复:

    prebundle: {
      enable: true,
      include: ['vue']
    }

类型问题也将在下一个版本同步修复

@ZakaryCode ZakaryCode removed the question Further information is requested label Aug 23, 2022
@agileago
Copy link
Collaborator Author

agileago commented Sep 3, 2022

下一个版本是3.6么?我看3.5.5没包含这个

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
F-vue3 Framework - Vue 3 T-h5 Target - 编译到 H5 V-3 Version - 3.x
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants