Bug Found in Mobify Tutorial - Fetching Data for a Page

Robert Young Jan 18, 2018 08:05AM PST

Hi there,

I work for Debenhams (we use Mobify to support our PWA). I am currently working on the 'Fetching Data For A Page' chapter of the 'Getting Started' Mobify Docs tutorial, and I came across the following issue:

In the 'Fetching Page Content' section, when I update the initProductListPage command in commands.js to look like this

export const initProductListPage = (url, routeName) => (dispatch) => {
return dispatch(fetchPageData(url))
.then(([$, $response]) => {
console.log($response)
})
}

to request a desktop page, I get the following error:

router.jsx:57 Uncaught (in promise) TypeError: dispatch(...).then is not a function
at router.jsx:57
at Object.dispatch (index.js:11)
at dispatch (<anonymous>:2:1620)
at Template.dispatchRouteChange (template.jsx:48)
at Template.componentWillMount (template.jsx:57)
at ReactCompositeComponent.js:348
at measureLifeCyclePerf (ReactCompositeComponent.js:75)
at ReactCompositeComponentWrapper.performInitialMount (ReactCompositeComponent.js:347)
at ReactCompositeComponentWrapper.mountComponent (ReactCompositeComponent.js:258)
at Object.mountComponent (ReactReconciler.js:46)

and

Uncaught (in promise) TypeError: Cannot read property 'getHostNode' of null
at Object.getHostNode (ReactReconciler.js:63)
at ReactCompositeComponentWrapper.getHostNode (ReactCompositeComponent.js:384)
at Object.getHostNode (ReactReconciler.js:63)
at ReactCompositeComponentWrapper.getHostNode (ReactCompositeComponent.js:384)
at Object.getHostNode (ReactReconciler.js:63)
at ReactCompositeComponentWrapper.getHostNode (ReactCompositeComponent.js:384)
at Object.getHostNode (ReactReconciler.js:63)
at ReactDOMComponent._updateChildren (ReactMultiChild.js:346)
at ReactDOMComponent.updateChildren (ReactMultiChild.js:299)
at ReactDOMComponent._updateDOMChildren (ReactDOMComponent.js:936)

Just wondered if you had an idea as to what might be causing these errors? I get a blank page with the blue 'Merlins Potions' header. If you like I can send you the entirety of the rest of the code that I have written for this tutorial, so we can have a go at debugging these issues...

Thanks,

Rob

London, UK



Up 0 rated Down
Robert Young Jan 18, 2018 08:53AM PST
Actually, upon a review of the code and pages today, this issue seems to have been resolved.

Post Your Public Answer

Your name (required)
Your email address (required)
Answer (required)
support@mobify.me
https://cdn.desk.com/
mobify
Loading
seconds ago
a minute ago
minutes ago
an hour ago
hours ago
a day ago
days ago
about
Invalid characters found
/customer/en/portal/articles/autocomplete