Skip to content

Race Condition with Worker #1171

@NateAGeek

Description

@NateAGeek

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 />)
    })

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions