-
-
Notifications
You must be signed in to change notification settings - Fork 901
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
Worker cannot be imported from different origin. #613
Comments
Well, you shouldn't do that. Loading scripts from different origins is usually a bad idea. |
As per Micro Front end architecture, i can load my one of the module script from another origin. |
Same problem here. We are using the new Module Federation in webpack 5 and we have the same issue. |
Please kindly check React-PDF These changes should result in 10-15 seconds faster Webpack builds, as well as you should be able to use Webpack entry file in Create-React-App, without the need of using external CDN for hosting worker. Let me know what you think in #748! |
Updating version to v5.3.0-beta.2 worked for me! 🎉 |
What are you trying to achieve? Please describe.
I have a web page under domain.com that uses a CDN for the JS files, the problem is that the origin is different then when I tri to import the worker Chrome says:
Uncaught DOMException: Failed to construct 'Worker' 'https://cdn.com' cannot be accessed from origin 'https:domain.com' and CORS are well configured.
I'm using this import
import { Document } from 'react-pdf/dist/esm/entry.webpack';
This is not happening in Firefox
Describe solutions you've tried
I tried to use a subdomain for the CDN like cdn.domain.com but not working neither.
The text was updated successfully, but these errors were encountered: