GoogleChrome / rendertron

A Headless Chrome rendering solution
https://render-tron.appspot.com/
Apache License 2.0
5.93k stars 800 forks source link

500 Internal Server Error with render-tron.appspot.com #261

Closed abdonrd closed 5 years ago

abdonrd commented 5 years ago

If I try the https://render-tron.appspot.com website and click on "Render & serialize" it doesn't work.

Link: https://render-tron.appspot.com/render/https://edited

abdonrd commented 5 years ago

It seems that the error occurs here:

https://github.com/GoogleChrome/rendertron/blob/6c3f002f489631efb761eedb7c939be9aa7b0a4b/src/renderer.ts#L136-L137

Error: Evaluation failed: TypeError: Cannot read property 'outerHTML' of undefined

abdonrd commented 5 years ago

It seems that the error has appeared when I went from @webcomponents/webcomponentsjs v2.2.1 to v2.2.2 or v2.2.3.

abdonrd commented 5 years ago

Changes are only dependencies (@webcomponents/shadycss & @webcomponents/shadydom):

https://github.com/webcomponents/webcomponentsjs/commits/master

Friendly ping to @azakus.

abdonrd commented 5 years ago

@keanulee could you deploy the master branch of pwa-starter-kit? So we can check with it:

https://render-tron.appspot.com/render/https://pwa-starter-kit.appspot.com

keanulee commented 5 years ago

Was able to reproduce with pwa-starter-kit-hn (https://render-tron.appspot.com/render/https://pwa-starter-kit-hn.appspot.com). Deployed a version that's pinned to webcomponentsjs@2.2.1 and it seems to at least load (https://render-tron.appspot.com/render/https://20190114t092629-dot-pwa-starter-kit-hn.appspot.com).

keanulee commented 5 years ago

Pretty sure it's the jump from webcomponentsjs 2.2.1 to 2.2.2, which as @abdonrd mentioned are version bumps of shadydom and shadycss, including:

Notably, the updates add patching to DOM methods including firstElementChild. Should be the same issue as https://github.com/webcomponents/shadydom/issues/307

keanulee commented 5 years ago

Even after locking to 2.2.1 though, the page loads but does not render anything in the <my-app> element. We suspect this is related to the bump from @polymer/lit-element to lit-element and possibly the new static styles getter. The new static styles getter in lit-element requires shadycss 1.8.0.

abdonrd commented 5 years ago

Same here! I have pinned v2.2.1 and removed the new static get styles().

keanulee commented 5 years ago

Fixed with webcomponentsjs@2.2.4; pwa-starter-kit updated and deployed. Thanks @abdonrd

Can you please close this issue? I actually can't on this repo.

abdonrd commented 5 years ago

Awesome, thanks @keanulee! I just deployed a new version with webcomponentsjs@2.2.4 and everything works fine now! 👏