Forum How do I...?

I keep getting the warning "prince: warning: document.write is not yet supported" despite having no such code

mgk81
We used to build Jekyll docs before passing them on to Prince on my Linux box.

Now, we build them in a Docker container to be toolchain-agnostic. For example:

docker run -ti --rm --user $(id -u):$(id -g) --name docs-container -v "$(pwd)":/src:rw -P --detach --network host docs-builder serve --config "_config.yml,pdfconfigs/${JEKYLL_CONFIG}"


Before, there were no issues, but now Prince keeps throwing the following warning numerous times (and the longer the guide, the more warnings occur.

prince: warning: document.write is not yet supported


Why is this happening and what am I doing wrong?
mikeday
Can you check your JavaScript for any calls to document.write?
mgk81
Mike, this is the first thing I checked. There are no such calls, neither in remote scripts nor in local scripts.

As I've been trying to explain, this warning never came up when I ran the Jekyll build locally and then the Prince build locally. Now that I run Jekyll in a Docker container and then Prince locally, it comes up every time.

This is why it doesn't make any sense and this is why I'm asking for help.
mikeday
Could you try capturing the job by running Prince with the --capture=DIR option? This will capture all of the scripts that are executed and make it easier to see what is going on.
mgk81
Mike, this has helped! We have found that it was Jekyll's livereload.js which was causing the issue:

<script>
  document.write(
    '<script src="http://' +
    (location.host || 'localhost').split(':')[0] +
    ':35729/livereload.js?snipver=1&amp;port=35729"' +
    '></' +
    'script>');
</script>