I'm able to reproduce what you're describing. I've added some notes re. the section(s) of R for Data Science, and then produced a little reprex (short for minimal reproducible example).
[n.b. I didn't really troubleshoot, but thought the reprex would be helpful for anyone else who reads this thread!]
suppressPackageStartupMessages(library(tidyverse))
library(modelr)
## R4DS: 24.2.1 Price and carat
diamonds2 <- diamonds %>%
filter(carat <= 2.5) %>%
mutate(lprice = log2(price), lcarat = log2(carat))
mod_diamond <- lm(lprice ~ lcarat, data = diamonds2)
grid <- diamonds2 %>%
data_grid(carat = seq_range(carat, 20)) %>%
mutate(lcarat = log2(carat)) %>%
add_predictions(mod_diamond, "lprice") %>%
mutate(price = 2 ^ lprice)
diamonds2 <- diamonds2 %>%
add_residuals(mod_diamond, "lresid")
## R4DS: 24.2.2 A more complicated model
mod_diamond2 <- lm(lprice ~ lcarat + color + cut + clarity, data = diamonds2)
grid <- diamonds2 %>%
data_grid(cut, .model = mod_diamond2) %>%
add_predictions(mod_diamond2)
#> Error in eval_tidy(xs[[i]], unique_output): object 'G' not found