score:0

A couple of things to note:

  • Next uses Webpack to build your application server-side. The URL paths must be imported as ES modules so that when Webpack modifies your files, the new URLs can be inserted correctly into your application.
  • If you are serving static files they must be located in the /public folder in the root of your application.

Example of modified code:

import LuisImg from '/public/shoes/men/luis/2'

const data = {
    products: [
      {
        _id: '1',
        name: 'Nike Slim Shirt',
        category: 'Shirts',
        image: LuisImg,
        price: 120,
        brand: 'Nike',
        rating: 4.5,
        size: 10,
        description: 'high quality product',
      },
      {
        _id: '2',
        name: 'Adidas Fit Shirt',
        category: 'Shirts',
        image: LuisImg,
        price: 100,
        brand: 'Adidas',
        rating: 4.0,
        size: 10,
        description: 'high quality product',
      },
      {
        _id: '3',
        name: 'Lacoste Free Shirt',
        category: 'Shirts',
        image: LuisImg,
        price: 220,
        brand: 'Lacoste',
        rating: 4.8,
        size: 17,
        description: 'high quality product',
      },
      {
        _id: '4',
        name: 'Nike Slim Pant',
        category: 'Pants',
        image: LuisImg,
        price: 78,
        brand: 'Nike',
        rating: 4.5,
        size: 14,
        description: 'high quality product',
      },
      {
        _id: '5',
        name: 'Puma Slim Pant',
        category: 'Pants',
        image: LuisImg,
        price: 65,
        brand: 'Puma',
        rating: 4.5,
        size: 10,
        description: 'high quality product',
      },
      {
        _id: '6',
        name: 'Adidas Fit Pant',
        category: 'Pants',
        image: LuisImg,
        price: 139,
        brand: 'Adidas',
        rating: 4.5,
        size: 15,
        description: 'high quality product',
      },
    ],
  };
  export default data;

Related Query

More Query from same tag