Im using jsdom-global to provide global DOM environment, but our helmet thinks it's in a browser and throw an error You may only call rewind() on the server. Call peek() to read the current state. every time I call renderStatic.
Can we have an option to ignore the side effect and just process as normal?
I figured out that I need to set the canUseDom to false. Then it will work fine. I think we should add some document about this field as well?
You are probably referring to canUseDOM instead.
Yeah, I have already figured it out, and ask if we can have a better documentation about that field then.
Thanks @namnm for the hint - it helped!
For other folks - call Helmet.canUseDOM = false; as soon as you import / require Helmet, otherwise you may get inconsistent results from Helmet.renderStatic()
Most helpful comment
Thanks @namnm for the hint - it helped!
For other folks - call
Helmet.canUseDOM = false;as soon as you import / requireHelmet, otherwise you may get inconsistent results fromHelmet.renderStatic()