Compilation order of files matters in Servant

I am observing one bug or “fix needed” thing with a Servant Project.

I have a set of source code files where each proxy is located in a separate file. The Authenticator is located in a separate file too.
If I clean before build ($ stack clean --full, $ stack build ), then I get a compilation error for one of the created proxies:

Couldn't match type ‘ServerT
                             (AuthProtect "cookie-auth" :> Raw) Handler’
                     with ‘p0 -> Tagged m0 Application’
      Expected type: ServerT RawProxy Handler
        Actual type: p0 -> ServerT Raw m0

But, if I change this “Not compiling” Proxy file a little, then try to build, then revert the changes, so that all the other files are considered “compiled” except this one, therefore this file also compiles. Therefore, I think that the compilation order of files really matters. Question: how to fix this issue?