Trying to build Moltin Next.js store


#1

Hi ,
I am trying to build next.js store from github, problem I am facing is that
error which comes
Cannot read property ‘data’ of undefined
at Object.data (E:\MOLTIN\STORECODE\VSREACTFRONT\pages\index.js:14:13)
at tryCatch (E:\MOLTIN\STORECODE\VSREACTFRONT\node_modules\regenerator-runtime\runtime.js:62:40)
at Generator.invoke [as _invoke] (E:\MOLTIN\STORECODE\VSREACTFRONT\node_modules\regenerator-runtime\runtime.js:296:22)
at Generator.prototype.(anonymous function) [as next] (E:\MOLTIN\STORECODE\VSREACTFRONT\node_modules\regenerator-runtime\runtime.js:114:21)
at step (E:\MOLTIN\STORECODE\VSREACTFRONT.next\dist\bundles\pages\index.js:631:191)
at E:\MOLTIN\STORECODE\VSREACTFRONT.next\dist\bundles\pages\index.js:631:361
at
at process._tickCallback (internal/process/next_tick.js:182:7)

Please Help.


#2

you can try change this code in pages/index.js :
const {
json: { data, included }
} = await getProducts()
to
const { data, included } = await getProducts()


#3

We tried to do above fix, error is still persisting.


#4

There is some error around, I did submit a pull request to fix those demo errors, but looks not approved yet, you can have a look here