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

主应用使用了importmap, 子应用中import, 有一定概率报错 #1538

Open
reStarting opened this issue Feb 28, 2025 · 0 comments
Open

Comments

@reStarting
Copy link

问题描述

主应用使用了
<script type="importmap">{"imports":{"vue":"https://esm.sh/vue"}}</script>
子应用在<script type="module">中使用import.meta.resolve('vue')
一定概率报错:child.html:12 Uncaught TypeError: Failed to resolve module specifier vue: Relative references must start with either "/", "./", or "../".

复现步骤

  1. pnpm i 安装依赖
  2. pnpm dev 运行项目
  3. 访问 http://localhost:5173
  4. 多次刷新页面, 有一定概率报错

上传截图

Image

复现仓库

https://github.com/reStarting/micro_app_importbug.git

环境信息

  • micro-app版本:1.0.0.rc.22
  • 主应用前端框架&版本:VanillaJS
  • 子应用前端框架&版本:VanillaJS
  • 构建工具&版本:[email protected]
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