github internxt/drive-web v1.0.792

6 hours ago

Description

Extract getEnvironmentConfig into its own module so the download Web Worker no longer imports React code transitively, fixing the Uncaught ReferenceError: window is not defined that prevented file downloads in dev mode. The worker imported fetchFileStream, which pulled getEnvironmentConfig from network.service/index.ts, and that barrel also imported notifyUserWithCooldownnotifications.servicereact-hot-toast and React components.

In dev, Vite has no tree-shaking and injects the @react-refresh HMR prelude into any module that looks like React code, and that prelude references window, which doesn't exist inside a Web Worker, so the worker crashed at load time.

In production it didn't surface because Rollup tree-shakes the unused branch and there's no HMR prelude, but the coupling was fragile.

Related Issues

Related Pull Requests

Checklist

  • Changes have been tested locally.
  • Unit tests have been written or updated as necessary.
  • The code adheres to the repository's coding standards.
  • Relevant documentation has been added or updated.
  • No new warnings or errors have been introduced.
  • SonarCloud issues have been reviewed and addressed.
  • QA Passed

Testing Process

Additional Notes

Don't miss a new drive-web release

NewReleases is sending notifications on new releases.