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

加载子应用后运行报错 Module scripts don't support importScripts(). #1410

Closed
YaoJianqun opened this issue Oct 16, 2024 · 4 comments
Closed
Labels
Need Reproduction 需要复现步骤

Comments

@YaoJianqun
Copy link

YaoJianqun commented Oct 16, 2024

问题描述

加载子应用后执行报错,实测1.0.0-rc.9及之后的版本都有这个问题,1.0.0-rc.8 正常运行,

上传截图

image

环境信息

  • micro-app版本:1.0.0-rc.12
  • 主应用前端框架&版本:Vue3 3.4.21
  • 子应用前端框架&版本:Vue3 3.4.21
  • 构建工具&版本:vite 5.1.5
@timhub66 timhub66 added the Need Reproduction 需要复现步骤 label Oct 16, 2024
@timhub66 timhub66 self-assigned this Oct 16, 2024
Copy link

Hello @YaoJianqun. In order to facilitate location and troubleshooting, we need you to provide a realistic GitHub repository.
您好 @YaoJianqun, 为了方便定位和排查问题,我们需要您提供一个重现实例,请提供一个尽可能精简的 GitHub 仓库地址。

@YaoJianqun
Copy link
Author

YaoJianqun commented Oct 18, 2024 via email

@timhub66
Copy link
Member

https://github.com/YaoJianqun/micro-app-bug-repository

@YaoJianqun ,换成module的导入导出方式就可以了,详细可参考如下

utils.js

function performComplexCalculation() {
  return "calculation";
}

export default performComplexCalculation

worker.js

import performComplexCalculation from 'http://localhost:6616/utils.js'

onmessage = function (event) {
  console.log(`主线程接收: ${event.data}`)

  const result = performComplexCalculation()

  postMessage(result)
}

@timhub66 timhub66 removed their assignment Oct 25, 2024
@github-actions github-actions bot closed this as completed Nov 2, 2024
Copy link

github-actions bot commented Nov 2, 2024

Since the issue was labeled with Need Reproduction, but no response in 7 days. This issue will be close. If you have any questions, you can comment and reply.
由于该 issue 被标记为需要可复现步骤,却 7 天未收到回应。现关闭 issue,若有任何问题,可评论回复。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Need Reproduction 需要复现步骤
Projects
None yet
Development

No branches or pull requests

2 participants