0

Uncaught (in promise) TypeError: Cannot read properties of undefined (reading ‘searchKeyword’) at getProducts (api.js:29:30) at Object.render (ProductListScreen.js:40:84) at router (index.js:74:33) sir, i have enrolled in your course but getting this error when trying to open products page from admin page. how to resolve this?

Answer:

to fix this issue, in this line:

https://github.com/basir/node-javascript-ecommerce/blob/master/frontend/src/srceens/ProductListScreen.js#L36

put {} inside function call:

const products = await getProducts({});

let me know if you have any issues.

Basir Answered question September 17, 2022