-
Notifications
You must be signed in to change notification settings - Fork 193
fix: issue with module workers #3046
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
base: master
Are you sure you want to change the base?
Conversation
|
This pull request has been automatically marked as stale because it has not had any activity for a long period. It will be closed and archived if no further activity occurs. However, we may return to this pull request in the future. If it is still relevant or you have any additional information regarding it, please leave a comment and we will keep it open. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR attempts to fix an issue with module workers by detecting whether a worker is a module worker and using import() instead of importScripts() to load the hammerhead library.
- Adds an
isModule()detection function that attempts to callimportScripts()to determine if the worker context is a module worker - Conditionally uses
import()for module workers andimportScripts()for classic workers - Updates the worker initialization code in the script header template
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Purpose
Describe the problem you want to address or the feature you want to implement.
Approach
Describe how your changes address the issue or implement the desired functionality in as much detail as possible.
References
Provide a link to the existing issue(s), if any.
Pre-Merge TODO