The function `foo`

below works as expected when ran interatively by printing the full `lavaan`

fit summary, but not when ran as a package function. Interactive (works):

```
foo <- function(fit){
print(summary(fit))
}
HS.model <- 'visual =~ x1 + x2 + x3'
library(lavaan)
fit <- lavaan::cfa(model = HS.model, data = HolzingerSwineford1939)
foo(fit)
#> lavaan 0.6-12 ended normally after 23 iterations
#>
#> Estimator ML
#> Optimization method NLMINB
#> Number of model parameters 6
#>
#> Number of observations 301
#>
------------------[TRUNCATED FOR BREVITY]----------------
Created on 2022-08-26 by the [reprex package](https://reprex.tidyverse.org)
```

But when the same function is ran from within package:

```
HS.model <- 'visual =~ x1 + x2 + x3'
library(lavaan)
library(lavaanExtra)
fit <- lavaan::cfa(model = HS.model, data = HolzingerSwineford1939)
foo(fit)
#> Length Class Mode
#> 1 lavaan S4
Created on 2022-08-26 by the [reprex package](https://reprex.tidyverse.org)
```

As can be seen, it prints length, class, and mode, rather than the fit summary, as when ran interactively. What might be the solution for surely such a common problem?