Trying to build Moltin Next.js store


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 (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\\dist\bundles\pages\index.js:631:191)
at E:\MOLTIN\STORECODE\\dist\bundles\pages\index.js:631:361
at process._tickCallback (internal/process/next_tick.js:182:7)

Please Help.


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


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


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