Missing Croct context

Resolve the error about the missing Croct request context.

If a loader or action throws an error like the one below, the SDK could not find the visitor context on the load context it received:

This happens when the request context was never resolved for the request, so the functions that fetch content and evaluate expressions have no visitor to act on.

Solution

Wire the request context for your setup, as described in the manual installation guide:

If you already wired it, make sure the loader or action reads the same context argument it receives, and that the middleware is registered on the root route so it runs for every request.