The following looks like a bug to me.
---
output: beamer_presentation
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE)
```
```{r}
library(gt)
library(janitor)
temp <- mtcars |> tabyl(vs,am)
temp
temp |> gt()
```
gives
! LaTeX Error: Environment longtable undefined.