-
-
Notifications
You must be signed in to change notification settings - Fork 347
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] Cross origin worker script fails to load for static site #2403
Comments
I'm attempting to fix this issue. In the meantime you can disable the beta version of the scripts and fallback to the old behavior to unblock yourself (although I would recommend enabling the beta version again when you're done since eventually that would be the only option, and it would be good to know that it still works as expected for you). |
The last fix didn't work because angular has disabled processing import.meta.url pattern for fetching assets at runtime, so will need to figure out another way to get the compiled JS file path for the web worker. |
Ooh.. actually this might work. |
Okay this issue requires a different solution. We may have to move away from using web workers as they are very strict with enforcing the same origin policy of the browser. The above solutions don't work because the web worker scripts are complex enough that loading them via blobs don't work. |
Actually it still wouldn't work just yet, since we expect a trusted origin. I'll remove that check in the next release. |
This is fixed in v7.1.0! 🎉 |
@imolorhe thanks for the fix and demo. I tried and this works in my own environment as well. |
Is there an existing issue for this?
Current Behavior
Similar to #1254 and also mentioned here graphql-dotnet/server#1110
When pre-request or post-request scripts are enabled worker fails to initialise and scripts do not run.
Expected Behavior
Pre/Post request script to execute without errors
Steps To Reproduce
The fiddle provided in issue #1254 https://jsfiddle.net/imolorhe/zrjh2x08/27/ also reproduces the same issue. Try a simple schema query when post or pre request script is enabled and populated.
https://jsfiddle.net/imolorhe/zrjh2x08/27/
js fiddle output:

Environment
Additional context
No response
The text was updated successfully, but these errors were encountered: