Missing route context

Find out how to solve route context issues.

The following error occurs when you call a function that requires the route context outside of App routes:

If you are using Page router  or API routes , you must manually provide the route context when calling the fetchContent, evaluate, identify, and anonymize functions. Check the documentation for examples on how to pass the route context for each function.

Note that the cql function cannot be used outside of App routes. This is because cql is a tag function, which does not accept additional parameters, so it relies on the route context to work. Attempting to use it outside the App routes will result in the following error:

For similar functionality outside of App routes, use the evaluate function instead.