Skip to content

Context is undefined in weird case. #1751

@Arilas

Description

@Arilas

Describe the bug

For some unknown reason context is undefined in loader, but it was present in beforeLoad

Your Example Website or App

https://github.com/Arilas/tanter-bug

Steps to Reproduce the Bug or Issue

  1. Clone
  2. yarn
  3. yarn dev
  4. Open Host
  5. Obserse error in src/routes/_secured.tsx
  6. Refresh the page
  7. Now it's working

Expected behavior

It should not clear the context

Screenshots or Videos

image

Platform

  • OS: macOS, iOS, Android
  • Browser: Arc, Safari
  • Version: latest

Additional context

I've over-simplified our case to the reproducible state. In our case we have a ServiceLocator with multiple factories, dependencies, events.

index.lazy.tsx can be replaced with an route with beforeLoad which will have redirects, but it was an workaround to fix problem previously.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions