Let $f\colon X \to S$ be a smooth proper morphism of schemes such that all fibers are geometrically connected of dimension $n$. Then the trace morphism yields an isomorphism $H^{2n}_{\rm DR}(X/S) \cong {\mathscr O}_S$ (here $H^p_{\rm DR}(X/S) = H^p(Rf_*\Omega^{\bullet}_{X/S})$ denotes the (relative) algebraic De Rham cohomology).

**Question**: What would be a correct generalization to morphisms of algebraic stacks?

For representable morphisms I would think (naively) that one might construct the trace morphism "as usual" and then prove it to be an isomorphism by a descent argument. But I did not check any details and a reference (or a counter example) would be appreciated very much.

For non-representable morphism it is maybe not even clear what the de Rham complex is in general? But even if $X$ is a Deligne-Mumford stack over a scheme $S$, I am not sure what the correct the generalization would be (I am worried about the example of the classifying stack of a finite $p$-group over a field of characteristic $p$).