I had a similar problem. In my case I was setting the "res.content" in the afterRender function to a custom string.

It worked at the time but after a while it just stopped working and I was getting the puppeteer error "Navigating frame was detached". Once I removed the setting of "res.content" everything was working properly.

I think the callback function done() needs to manipulate "res.content" so it needs to see the generated content.