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

微前端子应用加载 vue-pdf 时报跨域问题 #398

Open
liqian06 opened this issue Jan 5, 2023 · 2 comments
Open

微前端子应用加载 vue-pdf 时报跨域问题 #398

liqian06 opened this issue Jan 5, 2023 · 2 comments

Comments

@liqian06
Copy link

liqian06 commented Jan 5, 2023

image
网上找到了如下图所示的解决方式,但是需要改vue-pdf包中的源码,请问除了这种还有其他解决方式吗,还是说下个版本会更改这个文件呢
image
image

@SuperRonin
Copy link

至今没有好的解决方案吗,今天也遇到这个问题了,目前的解决方案是本地开发就设置浏览器跨域,因为我们主应用和子应用共享一个域名,上线后不存在这个问题。

@SuperRonin
Copy link

楼上的webpack配置貌似有误,我是这么配置的

config.module
      .rule('worker')
      .test(/\.worker\.js$/)
      .use('worker-loader')
      .loader('worker-loader')
      .options({
        inline: true,
        fallback: false,
      })
      .end()

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

2 participants