That must be the reason for the PhantomJs timeout (as it is based on WebKit, as Firefox and Chrome do).
If you can narrow down which js code cases the loop, you'll get the problem fixed.
Also, in the razor functions, you can check if PageRenderer.RenderingReason == RenderingReason.ScreenshotGeneration and output some different markup for previewing if the js functionality isn't vital for the preview.
If you can narrow down which js code cases the loop, you'll get the problem fixed.
Also, in the razor functions, you can check if PageRenderer.RenderingReason == RenderingReason.ScreenshotGeneration and output some different markup for previewing if the js functionality isn't vital for the preview.