Expo router types in CI pipelines

Hey everyone,

we’re started using Expo Router v2 in a new Expo 49 project recently and it’s a really great experience so far.
The typed routes are really great. However there is an issue when you have a CI pipeline checking for type correctness as the Expo Router types are generated and saved in the .expo folder which is git-ignored. Therefore the pipelines always fail with type errors.

For now we kind of workarounded that by adding the types to the repo which solves the issue in the CI, but it seems like the generation of the types isn’t stable. In a way that the order of things can change when they are recreated. Then you have to manually consider if you have navigation changes and need to check the changes in or not, because if you blindly add those you get a lot of conflicts.

The question now is, if there is any better way to handle this issue.
For example I can think of a function that creates the types once which we can run on the CI pipeline before the type-checking step. Or the type generation could be stable so that you can safely add the file to the repo and have it only be changed when there actually are changes in the navigation structure.

Every idea or tip is appreciated.

Cheers,
Oliver

PS: Maybe adding a new tag like “router”, “routing” or “navigation” could make sense now with Expo Router

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.