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

Race Condition with Worker #1171

Open
NateAGeek opened this issue Aug 27, 2024 · 0 comments
Open

Race Condition with Worker #1171

NateAGeek opened this issue Aug 27, 2024 · 0 comments

Comments

@NateAGeek
Copy link

Currently the worker.start() is not being returned or awaited, sometimes that will cause the worker to be started after react renders. Causing conflicts with React Router. Simple return should be able to fix this issue.

  import('../mocks/browser')
    .then(async ({ worker }) => {
      worker.start() // Will cause a race condition if not awaited or returned.
    }) // Run <App /> when Service Worker is ready to intercept requests.
    .then(() => {
      root.render(<App />)
    })
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant