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

[Bug] publicPath 对 worker 脚本不生效 #12781

Open
purple-force opened this issue Nov 14, 2024 · 0 comments
Open

[Bug] publicPath 对 worker 脚本不生效 #12781

purple-force opened this issue Nov 14, 2024 · 0 comments

Comments

@purple-force
Copy link

What happens?

项目中存在 worker 脚本时,设置 publicPath 不为 ‘/’ 时,worker 脚本相关的资源加载路径没有加上 publicPath

Mini Showcase Repository(REQUIRED)

仓库地址:https://github.com/purple-force/umi-micro-app-link
分支: worker

How To Reproduce

  1. 切换到 worker 分支,进入 app1 目录后并安装依赖
  2. npm start 启动项目
  3. 访问 http://localhost:3001/app1/docs
  4. 查看控制台,发现报错

image

发起了 http://localhost:3001/vendors-node_modules_umijs_react-refresh-webpack-plugin_lib_runtime_RefreshUtils_js-node_modu-8139f4.async.js 请求,缺少了 publicPath
实际上应该是 http://localhost:3001/app1/vendors-node_modules_umijs_react-refresh-webpack-plugin_lib_runtime_RefreshUtils_js-node_modu-8139f4.async.js

Context

  • Umi Version: 4.3.32
  • Node Version: v18.17.1
  • Platform: macos
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