stencil-community / stencil-router

A simple router for Stencil apps and sites
https://stenciljs.com/
MIT License
188 stars 55 forks source link

Error with componentWillLoad in SSR #36

Open mkv27 opened 6 years ago

mkv27 commented 6 years ago

With Express server example from docs

stencil-router:

[ ERROR ]  Runtime error detected during componentWillLoad(): stencil-router
           Cannot read property '_history' of null TypeError: Cannot read property '_history' of null at Window.get
           history [as history]

stencil-route:

[ ERROR ]  Runtime error detected during componentWillLoad(): stencil-route
           Cannot read property 'listenerList' of undefined TypeError: Cannot read property 'listenerList' of undefined
           at evalmachine.<anonymous>:3:464 at Object.subscribe (evalmachine.<anonymous>:3:550) at t.componentWillLoad
           (evalmachine.<anonymous>:2:2947) at update
John0x commented 6 years ago

Confirming with up to date packages

jedihacks commented 6 years ago

I see this as well; but only on a refresh (and not on the initial load of the page), which I suppose makes sense if refreshing clears history

ChBernat commented 5 years ago

Still an issue; Just FYI.

@Edit: It appears not only when user refreshes a webpage but also whenever you change route (testing on ssr starter after updating it to the newest ver.) thus it is clearly a bug and not something that makes sense, @jedihacks