The error expressen.se generated was the following
WARN: TypeError: Object is not a constructor (evaluating '{
visitor : {
age : '0',
gender : '0'
},
inventory : {
}
}') → about:blank on line 9 in function global code
But these where logged all as individual lines. So the first line was omitted because it has WARN at the start. But the following line is visitor : { which was interpreted as a real error. By removing the newlines, it is logged as one string.
I did the same for phantom.onError. Not sure if it is necessary for a specific case but I thought it wouldn't hurt.
I believe this solves https://github.com/sindresorhus/pageres/issues/256 and https://github.com/sindresorhus/pageres/issues/244.
The error
expressen.se
generated was the followingBut these where logged all as individual lines. So the first line was omitted because it has
WARN
at the start. But the following line isvisitor : {
which was interpreted as a real error. By removing the newlines, it is logged as one string.I did the same for
phantom.onError
. Not sure if it is necessary for a specific case but I thought it wouldn't hurt.