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

dynamic-import-weapp haven been supported ! but if import url have variable compile will error #11506

Closed
gowago opened this issue Mar 24, 2022 · 4 comments
Labels
enhancement New feature or request F-vue3 Framework - Vue 3 T-weapp Target - 编译到微信小程序 V-3 Version - 3.x

Comments

@gowago
Copy link

gowago commented Mar 24, 2022

相关平台

微信小程序

小程序基础库: 2.23.1
使用框架: Vue 3

复现步骤

const path = ''examplecComponentsFileName' ;
const AsyncComp = defineAsyncComponent(() => import(../../components/${path}.vue));

期望结果

动态 import 可以识别url 里面的变量

实际结果

小程序编译无法识别

环境信息

 Taro CLI 3.4.3 environment info:
    System:
      OS: Windows 10
    Binaries:
      Node: 16.14.0 - D:\Program Files\nodejs\node.EXE
      Yarn: 1.22.17 - C:\Users\Administrator\AppData\Roaming\npm\yarn.CMD
      npm: 8.3.1 - D:\Program Files\nodejs\npm.CMD

补充信息

vue3 异步加载组件 dymic import 里面 的url 变量 h5 可以编译成功但是小程序编译报错
编译警告 Critical dependency: the request of a dependency is an expression

@taro-bot2 taro-bot2 bot added F-vue3 Framework - Vue 3 T-weapp Target - 编译到微信小程序 V-3 Version - 3.x labels Mar 24, 2022
@github-actions
Copy link
Contributor

等待热心的小伙伴解决问题中..., 有一些相关的 issues 可能帮助到你!

Thank you so much!

@gowago gowago changed the title dymic imort 报错 dymic import 动态导入 组件报错 Mar 24, 2022
@Chen-jj Chen-jj added the enhancement New feature or request label Mar 29, 2022
@Chen-jj
Copy link
Contributor

Chen-jj commented Mar 29, 2022

暂不支持的

@ZakaryCode
Copy link
Contributor

小程序动态加载可以参考文档这里

@gowago
Copy link
Author

gowago commented Apr 1, 2022

小程序动态加载是支持的也编程成功了 但是import url 里面有变量 小程序编译就回报错

@gowago gowago changed the title dymic import 动态导入 组件报错 dynamic-import-weapp haven been supported ! but if import url have variable compile will error Apr 1, 2022
@Chen-jj Chen-jj closed this as completed Apr 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request F-vue3 Framework - Vue 3 T-weapp Target - 编译到微信小程序 V-3 Version - 3.x
Projects
None yet
Development

No branches or pull requests

3 participants