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

fix: check for Blob before creating worker URL (close #4462) #4674

Merged
merged 2 commits into from
Sep 6, 2021

Conversation

andreasg123
Copy link
Contributor

@andreasg123 andreasg123 commented Aug 21, 2021

Description

Fixes #4462

With server-side rendering, in my case Next.js, Blob isn't defined in Node.js. That causes the generated output for web workers to fail. This adds a check for the availability of Blob to the generated code. In its absence, the previous approach is being used. The concatenation of a long string introduces a slight inefficiency. However, I'm happy that things work again and the function WorkerWrapper may not even be called.


What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

Before submitting the PR, please make sure you do the following

  • Read the Contributing Guidelines.
  • Read the Pull Request Guidelines and follow the Commit Convention.
  • Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
  • Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g. fixes #123).
  • Ideally, include relevant tests that fail without this PR but pass with it.

I'm not really sure how to test this but I'm open to suggestions.

@Shinigami92 Shinigami92 added feat: ssr feat: web workers p3-minor-bug An edge case that only affects very specific usage (priority) labels Aug 21, 2021
@Shinigami92 Shinigami92 self-requested a review August 21, 2021 08:36
@Shinigami92
Copy link
Member

Can we implement a test for the new behavior that fails without the change?

@andreasg123
Copy link
Contributor Author

I adapted the test from #3468 that introduced the use of Blob for creating a worker.

@andreasg123
Copy link
Contributor Author

Could you please tell me if this is scheduled to be merged and released? It would really help with the issue that I have with using the current version of https://github.com/hms-dbmi/viv

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat: ssr feat: web workers p3-minor-bug An edge case that only affects very specific usage (priority)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"Blob is not defined" error for inline web worker in SSR mode
4 participants