Estoy haciendo el tutorial de youtube "Ecommerce Web Shop - Build & Deploy an Amazing App | React.js, Commerce.js, Stripe" y este error apareció cuando estaba enviando un nuevo objeto de producto desde Commerce.js. (minuto 45:50) Tengo el código correspondiente:
import React, {useState, useEffect } from 'react'; import { commerce } from './lib/commerce' import {Products, Navbar } from './components' // to create a full function web shell app, we need a // full api that is stored on commerce import const App = () => { //new state const [products, setProducts] = useState([]); // fetch data from the commerce instance // fetch the products immediatelly on the aplication load const fetchProducts = async () => { // this is going to return a promise that we have to // await to see what is inside of that promise const { data } = await commerce.products.list(); // now the products are going to be populated setProducts(data); } /* this is to call the fetch product function and set products to the state, the empty list means that it's only going to render at the start */ useEffect(() => { fetchProducts(); },[]); console.log(products); return ( <div> <Navbar/> <Products/> </div> ); } export default App;[Debería haber impreso el objeto en la consola, pero en cambio tengo el error]