vuestorefront / vue-storefront

Alokai is a Frontend as a Service solution that simplifies composable commerce. It connects all the technologies needed to build and deploy fast & scalable ecommerce frontends. It guides merchants to deliver exceptional customer experiences quickly and easily.
https://www.alokai.com
MIT License
10.59k stars 2.08k forks source link

Storefront not working inside docker #2093

Closed Darwex closed 5 years ago

Darwex commented 5 years ago

Current behavior

Vue-storefront shows error, something went wrong when started inside docker via docker-compose. It seems to return error below when trying to connect to elastic search. Kibana is on the same network connected with same credentials successfully.

I am just truing to wrap it now, I will polish it later on.

The js error after placing breakpoint inside search.ts

"ReferenceError: pe is not defined
    at eval (eval at <anonymous> (http://localhost:3000/dist/app.8224a1c2b93dcaeb782b.js?_sw-precache=9683acc21aef6ab20ee92a89ed59b3e6:1:283927), <anonymous>:1:1)
    at http://localhost:3000/dist/app.8224a1c2b93dcaeb782b.js?_sw-precache=9683acc21aef6ab20ee92a89ed59b3e6:1:283927
    at new Promise (<anonymous>)
    at ce (http://localhost:3000/dist/app.8224a1c2b93dcaeb782b.js?_sw-precache=9683acc21aef6ab20ee92a89ed59b3e6:1:282537)
    at list (http://localhost:3000/dist/app.8224a1c2b93dcaeb782b.js?_sw-precache=9683acc21aef6ab20ee92a89ed59b3e6:1:302727)
    at Array.<anonymous> (http://localhost:3000/dist/vendor.8224a1c2b93dcaeb782b.js?_sw-precache=f0984bdc47244cc1c021abb65b5aa744:13:5308)
    at l.dispatch (http://localhost:3000/dist/vendor.8224a1c2b93dcaeb782b.js?_sw-precache=f0984bdc47244cc1c021abb65b5aa744:13:6675)
    at l.dispatch (http://localhost:3000/dist/vendor.8224a1c2b93dcaeb782b.js?_sw-precache=f0984bdc47244cc1c021abb65b5aa744:13:2938)
    at http://localhost:3000/dist/app.8224a1c2b93dcaeb782b.js?_sw-precache=9683acc21aef6ab20ee92a89ed59b3e6:1:476771
    at new Promise (<anonymous>)"

My docker-compose

version: '3.0'
services:

  vue-storefront:
    container_name: vue_storefront
    build:
      context: ./vue-storefront
      dockerfile: docker/vue-storefront/Dockerfile
    env_file:
      - ./vue-storefront/docker/vue-storefront/default.env
    volumes:
    - './vue-storefront/.babelrc:/var/www/.babelrc'
    - './vue-storefront/core:/var/www/core'
    - './vue-storefront/ecosystem.json:/var/www/ecosystem.json'
    - './vue-storefront/.eslintignore:/var/www/.eslintignore'
    - './vue-storefront/.eslintrc.js:/var/www/.eslintrc.js'
    - './vue-storefront/lerna.json:/var/www/lerna.json'
    - './vue-storefront/tsconfig.json:/var/www/tsconfig.json'
    - './vue-storefront/shims.d.ts:/var/www/shims.d.ts'
    - './vue-storefront/package.json:/var/www/package.json'
    - './vue-storefront/src:/var/www/src'
    - './vue-storefront/var:/var/www/var'
    depends_on:
      - vue-storefront-api
    networks:
      - vue_network
    ports:
      - 3000:3000

  vue-storefront-api:
    build:
      context: ./vue-storefront-api
      dockerfile: docker/vue-storefront-api/Dockerfile
    env_file: ./vue-storefront-api/docker/vue-storefront-api/default.env
    volumes:
    - './vue-storefront-api/config:/var/www/config'
    - './vue-storefront-api/ecosystem.json:/var/www/ecosystem.json'
    - './vue-storefront-api/migrations:/var/www/migrations'
    - './vue-storefront-api/package.json:/var/www/package.json'
    - './vue-storefront-api/scripts:/var/www/scripts'
    - './vue-storefront-api/src:/var/www/src'
    - './vue-storefront-api/var:/var/www/var'
    tmpfs:
      - /var/www/dist
    depends_on:
      - redis
      - elastic-search
      - kibana
    networks:
      - vue_network
    ports:
      - 8080:8080

  redis:
    container_name: vue_storefront_redis
    image: 'redis:4-alpine'
    networks:
      - vue_network
    ports:
      - 6379:6379

  elastic-search:
    container_name: vue_storefront_elasticsearch
    build:
      context: ./vue-storefront-api
      dockerfile: ./docker/elasticsearch/Dockerfile
    volumes:
    - ./vue-storefront-api/docker/elasticsearch/config/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml:ro
    - 'esdat1:/usr/share/elasticsearch/data'
    environment:
      ES_JAVA_OPTS: "-Xmx512m -Xms512m"
    networks:
      - vue_network
    ports:
      - 9200:9200
      - 9300:9300

  kibana:
    container_name: vue_storefront_kibana
    build:
      context: ./vue-storefront-api
      dockerfile: ./docker/kibana/Dockerfile
    volumes:
      - ./vue-storefront-api/docker/kibana/config/:/usr/share/kibana/config:ro
    ports:
      - 5601:5601
    networks:
      - vue_network

networks:
  vue_network:
    driver: 'bridge'

volumes:
  esdat1:

vue-storefront-api config - elastic search section (the same as for Kibana)

"elasticsearch": {
    "host": "http://vue_storefront_elasticsearch",
    "port": 9200,
    "user": "elastic",
    "password": "changeme",
    "min_score": 0.01,
    "indices": [
      "vue_storefront_catalog",
      "vue_storefront_catalog_de",
      "vue_storefront_catalog_it"
    ],
    "indexTypes": [
      "product",
      "category",
      "cms",
      "attribute",
      "taxrule",
      "review"
    ]
  }

Expected behavior

It should be working even inside docker.

Steps to reproduce the issue

Folder structure image

  1. Create the docker-compose mentioned above.

  2. Change line 6 vue-storefront/docker/vue-storefront/vue-storefront.sh line 6

    yarn build:client && yarn build:server && yarn build:sw || exit $?

    Added sw build, because it was missing inside dist folder.

  3. go to http://localhost:3000

  4. open console and click on top left arrow back image

Can you handle fixing this bug by yourself?

No.

Environment details

See the repository.

pkarw commented 5 years ago

Do You have any error in dev mode / outside the docker? Is the vsapi accessible to connect to from vs docker? It seems like a lack of connectivity for ssr (server side) app to Vue Storefront api. Please also attach Your vs and vsapi config files to give us some more info

pkarw commented 5 years ago

If you’re connecting to vsapi using “localhost” not the public IP please make sure your containers work in host network mode

Darwex commented 5 years ago

I do not see any errors outside docker. I also suspect docker networking but the error I received seemed unclear to me, since I do not know vue-storefront well enough. When I start the docker-compose up i can access the vsapi via browser as well as vue-storefront and kibana (connected to elastic) that is what confuses me.

Please see my vs and vsapi configs below.

vs config

{
  "server": {
    "host": "0.0.0.0",
    "port": 3000,
    "protocol": "http",
    "api": "api",
    "useOutputCacheTagging": false,
    "useOutputCache": false,
    "outputCacheDefaultTtl": 86400,
    "availableCacheTags": ["product", "category", "home", "checkout", "page-not-found", "compare", "my-account", "P", "C", "error"],
    "invalidateCacheKey": "aeSu7aip",
    "dynamicConfigReload": false,
    "dynamicConfigExclude": ["ssr", "storeViews", "entities", "localForage", "shipping", "boost", "query"],
    "dynamicConfigInclude": []
  },
  "console": {
    "verbosityLevel": "only-errors"
  },
  "redis": {
    "host": "localhost",
    "port": 6379,
    "db": 0
  },
  "graphql":{
    "host": "localhost",
    "port": 8080
  },
  "elasticsearch": {
    "httpAuth": "",
    "host": "localhost:8080/api/catalog",
    "index": "vue_storefront_catalog",
    "min_score": 0.02,
    "csrTimeout": 5000,
    "ssrTimeout": 1000
  },
  "ssr": {
    "templates": {
      "default": "dist/index.html",
      "minimal": "dist/index.minimal.html",
      "basic": "dist/index.basic.html"
    },
    "executeMixedinAsyncData": true,
    "initialStateFilter": ["__DEMO_MODE__", "version", "storeView"],
    "useInitialStateFilter": true
  },
  "defaultStoreCode": "",
  "storeViews": {
    "multistore": false,
    "mapStoreUrlsFor": ["de", "it"],
    "de": {
      "storeCode": "de",
      "disabled": true,
      "storeId": 3,
      "name": "German Store",
      "url": "/de",
      "elasticsearch": {
        "host": "localhost:8080/api/catalog",
        "index": "vue_storefront_catalog_de"
      },
      "tax": {
        "sourcePriceIncludesTax": false,
        "defaultCountry": "DE",
        "defaultRegion": "",
        "calculateServerSide": true
      },
      "i18n": {
        "fullCountryName": "Germany",
        "fullLanguageName": "German",
        "defaultLanguage": "DE",
        "defaultCountry": "DE",
        "defaultLocale": "de-DE",
        "currencyCode": "EUR",
        "currencySign": "EUR",
        "dateFormat": "HH:mm D-M-YYYY"
      }
    },
    "it": {
      "storeCode": "it",
      "disabled": true,
      "storeId": 4,
      "name": "Italian Store",
      "url": "/it",
      "elasticsearch": {
        "host": "localhost:8080/api/catalog",
        "index": "vue_storefront_catalog_it"
      },
      "tax": {
        "sourcePriceIncludesTax": false,
        "defaultCountry": "IT",
        "defaultRegion": "",
        "calculateServerSide": true
      },
      "i18n": {
        "fullCountryName": "Italy",
        "fullLanguageName": "Italian",
        "defaultCountry": "IT",
        "defaultLanguage": "IT",
        "defaultLocale": "it-IT",
        "currencyCode": "EUR",
        "currencySign": "EUR",
        "dateFormat": "HH:mm D-M-YYYY"
      }
    }
  },
  "entities": {
    "optimize": true,
    "twoStageCaching": true,
    "optimizeShoppingCart": true,
    "category": {
      "includeFields": [ "children_data", "id", "children_count", "sku", "name", "is_active", "parent_id", "level", "url_key", "product_count", "path"]
    },
    "attribute": {
      "includeFields": [ "attribute_code", "id", "entity_type_id", "options", "default_value", "is_user_defined", "frontend_label", "attribute_id", "default_frontend_label", "is_visible_on_front", "is_visible", "is_comparable", "tier_prices" ]
    },
    "productList": {
      "sort": "",
      "includeFields": [ "type_id", "sku", "product_links", "tax_class_id", "special_price", "special_to_date", "special_from_date", "name", "price", "priceInclTax", "originalPriceInclTax", "originalPrice", "specialPriceInclTax", "id", "image", "sale", "new", "url_key", "status", "tier_prices" ],
      "excludeFields": [ "configurable_children", "description", "configurable_options", "sgn" ]
    },
    "productListWithChildren": {
      "includeFields": [ "type_id", "sku", "name", "tax_class_id", "special_price", "special_to_date", "special_from_date", "price", "priceInclTax", "originalPriceInclTax", "originalPrice", "specialPriceInclTax", "id", "image", "sale", "new", "configurable_children.image", "configurable_children.sku", "configurable_children.price", "configurable_children.special_price", "configurable_children.priceInclTax", "configurable_children.specialPriceInclTax", "configurable_children.originalPrice", "configurable_children.originalPriceInclTax", "configurable_children.color", "configurable_children.size", "configurable_children.id", "configurable_children.tier_prices", "product_links", "url_key", "status", "tier_prices"],
      "excludeFields": [ "description", "sgn"]
    },
    "review": {
      "excludeFields": ["review_entity", "review_status"]
    },
    "product": {
      "excludeFields": [ "updated_at", "created_at", "attribute_set_id", "options_container", "msrp_display_actual_price_type", "has_options", "stock.manage_stock", "stock.use_config_min_qty", "stock.use_config_notify_stock_qty", "stock.stock_id",  "stock.use_config_backorders", "stock.use_config_enable_qty_inc", "stock.enable_qty_increments", "stock.use_config_manage_stock", "stock.use_config_min_sale_qty", "stock.notify_stock_qty", "stock.use_config_max_sale_qty", "stock.use_config_max_sale_qty", "stock.qty_increments", "small_image"],
      "includeFields": null
    }
  },
  "cart": {
    "bypassCartLoaderForAuthorizedUsers": true,
    "multisiteCommonCart": true,
    "server_merge_by_default": true,
    "synchronize": true,
    "synchronize_totals": true,
    "setCustomProductOptions": true,
    "setConfigurableProductOptions": true,
    "create_endpoint": "http://localhost:8080/api/cart/create?token={{token}}",
    "updateitem_endpoint": "http://localhost:8080/api/cart/update?token={{token}}&cartId={{cartId}}",
    "deleteitem_endpoint": "http://localhost:8080/api/cart/delete?token={{token}}&cartId={{cartId}}",
    "pull_endpoint": "http://localhost:8080/api/cart/pull?token={{token}}&cartId={{cartId}}",
    "totals_endpoint": "http://localhost:8080/api/cart/totals?token={{token}}&cartId={{cartId}}",
    "paymentmethods_endpoint": "http://localhost:8080/api/cart/payment-methods?token={{token}}&cartId={{cartId}}",
    "shippingmethods_endpoint": "http://localhost:8080/api/cart/shipping-methods?token={{token}}&cartId={{cartId}}",
    "shippinginfo_endpoint": "http://localhost:8080/api/cart/shipping-information?token={{token}}&cartId={{cartId}}",
    "collecttotals_endpoint": "http://localhost:8080/api/cart/collect-totals?token={{token}}&cartId={{cartId}}",
    "deletecoupon_endpoint": "http://localhost:8080/api/cart/delete-coupon?token={{token}}&cartId={{cartId}}",
    "applycoupon_endpoint": "http://localhost:8080/api/cart/apply-coupon?token={{token}}&cartId={{cartId}}&coupon={{coupon}}"
  },
  "products": {
    "useShortCatalogUrls": false,
    "useMagentoUrlKeys": false,
    "setFirstVarianAsDefaultInURL": false,
    "configurableChildrenStockPrefetchStatic": false,
    "configurableChildrenStockPrefetchDynamic": false,
    "configurableChildrenStockPrefetchStaticPrefetchCount": 8,
    "filterUnavailableVariants": false,
    "listOutOfStockProducts": false,
    "preventConfigurableChildrenDirectAccess": true,
    "alwaysSyncPlatformPricesOver": false,
    "clearPricesBeforePlatformSync": false,
    "waitForPlatformSync": false,
    "setupVariantByAttributeCode": true,
    "endpoint": "http://localhost:8080/api/product",
    "defaultFilters": ["color", "size", "price", "erin_recommends"],
    "filterFieldMapping": {
      "category.name": "category.name.keyword"
    },
    "sortByAttributes": {
      "Latest": "updated_at",
      "Price":"final_price"
    },
    "gallery": {
      "variantsGroupAttribute": "color",
      "mergeConfigurableChildren": true,
      "imageAttributes": ["image","thumbnail","small_image"],
      "width": 600,
      "height": 744
    }
  },
  "orders": {
    "endpoint": "http://localhost:8080/api/order",
    "payment_methods_mapping": {
    },
    "offline_orders": {
      "automatic_transmission_enabled": false,
      "notification" : {
        "enabled": true,
        "title" : "Order waiting!",
        "message": "Click here to confirm the order that you made offline.",
        "icon": "/assets/logo.png"
      }
    }
  },
  "localForage": {
    "defaultDrivers": {
      "user": "LOCALSTORAGE",
      "carts": "LOCALSTORAGE",
      "orders": "LOCALSTORAGE",
      "wishlist": "INDEXEDDB",
      "categories": "INDEXEDDB",
      "attributes": "INDEXEDDB",
      "products": "INDEXEDDB",
      "elasticCache": "INDEXEDDB",
      "claims": "LOCALSTORAGE",
      "compare": "INDEXEDDB",
      "syncTasks": "INDEXEDDB",
      "ordersHistory": "INDEXEDDB",
      "checkoutFieldValues": "LOCALSTORAGE"
    }
  },
  "reviews": {
    "create_endpoint": "http://localhost:8080/api/review/create"
  },
  "users": {
    "autoRefreshTokens": true,
    "endpoint": "http://localhost:8080/api/user",
    "history_endpoint": "http://localhost:8080/api/user/order-history?token={{token}}",
    "resetPassword_endpoint": "http://localhost:8080/api/user/reset-password",
    "changePassword_endpoint": "http://localhost:8080/api/user/change-password?token={{token}}",
    "login_endpoint": "http://localhost:8080/api/user/login",
    "create_endpoint": "http://localhost:8080/api/user/create",
    "me_endpoint": "http://localhost:8080/api/user/me?token={{token}}",
    "refresh_endpoint": "http://localhost:8080/api/user/refresh"
  },
  "stock": {
    "synchronize": true,
    "allowOutOfStockInCart": true,
    "endpoint": "http://localhost:8080/api/stock"
  },
  "images": {
    "baseUrl": "https://demo.vuestorefront.io/img/",
    "productPlaceholder": "/assets/placeholder.jpg"
  },
  "install": {
    "is_local_backend": true,
    "backend_dir": "../vue-storefront-api"
  },
  "demomode": false,
  "tax": {
    "defaultCountry": "PL",
    "defaultRegion": "",
    "sourcePriceIncludesTax": false,
    "calculateServerSide": true
  },
  "shipping": {
    "methods": [
      {
        "method_title": "DPD Courier",
        "method_code": "flatrate",
        "carrier_code": "flatrate",
        "amount": 4,
        "price_incl_tax": 5,
        "default": true,
        "offline": true
      }
    ]
  },
  "i18n": {
    "defaultCountry": "US",
    "defaultLanguage": "EN",
    "availableLocale": ["en-US","de-DE","fr-FR","es-ES","nl-NL", "jp-JP", "ru-RU", "it-IT", "pt-BR", "pl-PL"],
    "defaultLocale": "en-US",
    "currencyCode": "USD",
    "currencySign": "$",
    "dateFormat": "HH:mm D/M/YYYY",
    "fullCountryName": "United States",
    "fullLanguageName": "English",
    "bundleAllStoreviewLanguages": true
  },
  "mailchimp": {
    "endpoint": "http://localhost:8080/api/ext/mailchimp-subscribe/subscribe"
  },
  "mailer": {
    "endpoint": {
      "send": "http://localhost:8080/api/ext/mail-service/send-email",
      "token": "http://localhost:8080/api/ext/mail-service/get-token"
    },
    "contactAddress": "contributors@vuestorefront.io",
    "sendConfirmation": true
  },
  "theme": "@vue-storefront/theme-default",
  "analytics": {
    "id": false
  },
  "stripe": {
    "api_key": "my_example_api_key"
  },
  "cms": {
    "endpoint": "http://localhost:8080/api/ext/cms-data/cms{{type}}/{{cmsId}}",
    "endpointIdentifier": "http://localhost:8080/api/ext/cms-data/cms{{type}}Identifier/{{cmsIdentifier}}/storeId/{{storeId}}"
  },
  "usePriceTiers": false,
  "boost": {
    "name": 3,
    "category.name": 1,
    "short_description": 1,
    "description": 1,
    "sku": 1,
    "configurable_children.sku": 1
  },
  "query": {
    "inspirations": {
      "filter": [
        {
          "key": "category.name",
          "value" : { "eq": "Performance Fabrics" }
        }
      ]
    },
    "newProducts": {
      "filter": [
        {
          "key": "category.name",
          "value" : { "eq": "Tees" }
        }
      ]
    },
    "coolBags": {
      "filter": [
        {
          "key": "category.name",
          "value" : { "eq": "Women" }
        }
      ]
    },
    "bestSellers": {
      "filter": [
        {
          "key": "category.name",
          "value" : { "eq": "Tees" }
        }
      ]
    }
  }

}

vsapi config

{
  "server": {
    "host": "localhost",
    "port": 8080,
    "searchEngine": "elasticsearch"
  },
  "elasticsearch": {
    "host": "http://vue_storefront_elasticsearch",
    "port": 9200,
    "user": "elastic",
    "password": "changeme",
    "min_score": 0.01,
    "indices": [
      "vue_storefront_catalog",
      "vue_storefront_catalog_de",
      "vue_storefront_catalog_it"
    ],
    "indexTypes": [
      "product",
      "category",
      "cms",
      "attribute",
      "taxrule",
      "review"
    ]
  },
  "redis": {
    "host": "localhost",
    "port": 6379,
    "db": 0
  },
  "kue": {},
  "availableStores": [
    "de",
    "it"
  ],
  "storeViews": {
    "multistore": true,
    "mapStoreUrlsFor": [
      "de",
      "it"
    ],
    "de": {
      "storeCode": "de",
      "disabled": true,
      "storeId": 3,
      "name": "German Store",
      "url": "/de",
      "elasticsearch": {
        "host": "localhost:8080/api/catalog",
        "index": "vue_storefront_catalog_de"
      },
      "tax": {
        "defaultCountry": "DE",
        "defaultRegion": "",
        "calculateServerSide": true,
        "sourcePriceIncludesTax": false
      },
      "i18n": {
        "fullCountryName": "Germany",
        "fullLanguageName": "German",
        "defaultLanguage": "DE",
        "defaultCountry": "DE",
        "defaultLocale": "de-DE",
        "currencyCode": "EUR",
        "currencySign": "EUR",
        "dateFormat": "HH:mm D-M-YYYY"
      }
    },
    "it": {
      "storeCode": "it",
      "disabled": true,
      "storeId": 4,
      "name": "Italian Store",
      "url": "/it",
      "elasticsearch": {
        "host": "localhost:8080/api/catalog",
        "index": "vue_storefront_catalog_it"
      },
      "tax": {
        "defaultCountry": "IT",
        "defaultRegion": "",
        "calculateServerSide": true,
        "sourcePriceIncludesTax": false
      },
      "i18n": {
        "fullCountryName": "Italy",
        "fullLanguageName": "Italian",
        "defaultCountry": "IT",
        "defaultLanguage": "IT",
        "defaultLocale": "it-IT",
        "currencyCode": "EUR",
        "currencySign": "EUR",
        "dateFormat": "HH:mm D-M-YYYY"
      }
    }
  },
  "authHashSecret": "__SECRET_CHANGE_ME__",
  "objHashSecret": "__SECRET_CHANGE_ME__",
  "cart": {
    "setConfigurableProductOptions": false
  },
  "tax": {
    "defaultCountry": "PL",
    "defaultRegion": "",
    "calculateServerSide": true,
    "alwaysSyncPlatformPricesOver": false,
    "usePlatformTotals": true,
    "setConfigurableProductOptions": true,
    "sourcePriceIncludesTax": false
  },
  "bodyLimit": "100kb",
  "corsHeaders": [
    "Link"
  ],
  "platform": "magento2",
  "registeredExtensions": [
    "mailchimp-subscribe",
    "example-magento-api",
    "cms-data",
    "mail-service"
  ],
  "extensions": {
    "mailchimp": {
      "listId": "e06875a7e1",
      "apiKey": "a9a3318ea7d30f5c5596bd4a78ae0985-us3",
      "apiUrl": "https://us3.api.mailchimp.com/3.0"
    },
    "mailService": {
      "transport": {
        "host": "smtp.gmail.com",
        "port": 465,
        "secure": true,
        "user": "vuestorefront",
        "pass": "vuestorefront.io"
      },
      "targetAddressWhitelist": ["contributors@vuestorefront.io"],
      "secretString": "__THIS_IS_SO_SECRET__"
    }
  },
  "magento2": {
    "url": "host-url",
    "imgUrl": "http://demo-magento2.vuestorefront.io/media/catalog/product",
    "assetPath": "/../var/magento2-sample-data/pub/media",
    "magentoUserName": "",
    "magentoUserPassword": "",
    "httpUserName": "",
    "httpUserPassword": "",
    "api": {
      "url": the-host/rest",
      "consumerKey": "key",
      "consumerSecret": "secret",
      "accessToken": "token",
      "accessTokenSecret": "token-secret"
    }
  },
  "imageable": {
    "namespace": "",
    "maxListeners": 512,
    "imageSizeLimit": 1024,
    "whitelist": {
      "allowedHosts": [
        ".*divante.pl",
        ".*vuestorefront.io"
      ]
    },
    "cache": {
      "memory": 50,
      "files": 20,
      "items": 100
    },
    "concurrency": 0,
    "counters": {
      "queue": 2,
      "process": 4
    },
    "simd": true,
    "keepDownloads": true
  },
  "entities": {
    "category": {
      "includeFields": [ "children_data", "id", "children_count", "sku", "name", "is_active", "parent_id", "level", "url_key" ]
    },
    "attribute": {
      "includeFields": [ "attribute_code", "id", "entity_type_id", "options", "default_value", "is_user_defined", "frontend_label", "attribute_id", "default_frontend_label", "is_visible_on_front", "is_visible", "is_comparable" ]
    },
    "productList": {
      "sort": "",
      "includeFields": [ "type_id", "sku", "product_links", "tax_class_id", "special_price", "special_to_date", "special_from_date", "name", "price", "priceInclTax", "originalPriceInclTax", "originalPrice", "specialPriceInclTax", "id", "image", "sale", "new", "url_key" ],
      "excludeFields": [ "configurable_children", "description", "configurable_options", "sgn" ]
    },
    "productListWithChildren": {
      "includeFields": [ "type_id", "sku", "name", "tax_class_id", "special_price", "special_to_date", "special_from_date", "price", "priceInclTax", "originalPriceInclTax", "originalPrice", "specialPriceInclTax", "id", "image", "sale", "new", "configurable_children.image", "configurable_children.sku", "configurable_children.price", "configurable_children.special_price", "configurable_children.priceInclTax", "configurable_children.specialPriceInclTax", "configurable_children.originalPrice", "configurable_children.originalPriceInclTax", "configurable_children.color", "configurable_children.size", "product_links", "url_key"],
      "excludeFields": [ "description", "sgn"]
    },
    "product": {
      "excludeFields": [ "updated_at", "created_at", "attribute_set_id", "status", "visibility", "tier_prices", "options_container", "msrp_display_actual_price_type", "has_options", "stock.manage_stock", "stock.use_config_min_qty", "stock.use_config_notify_stock_qty", "stock.stock_id",  "stock.use_config_backorders", "stock.use_config_enable_qty_inc", "stock.enable_qty_increments", "stock.use_config_manage_stock", "stock.use_config_min_sale_qty", "stock.notify_stock_qty", "stock.use_config_max_sale_qty", "stock.use_config_max_sale_qty", "stock.qty_increments", "small_image"],
      "includeFields": null,
      "filterFieldMapping": {
        "category.name": "category.name.keyword"
      }
    }
  },
  "usePriceTiers": false,
  "boost": {
    "name": 3,
    "category.name": 1,
    "short_description": 1,
    "description": 1,
    "sku": 1,
    "configurable_children.sku": 1
  }
}

vs seem to successfully connect to vsapi in the browser.

Thanks for your help. I appreciate it.

Darwex commented 5 years ago

I managed to solve this.

vue-storefront-api/docker/vue-storefront-api/default.env contains elastic-search config as well, and it is overriding the default one in config.local.

You can either delete it from the default.env or alter it there.

The truth is, that the error message was not very clear. Maybe we could improve error handling for connection issues.

Thanks for help. Closing the issue.

bay20soft commented 5 years ago

Is there any option to enable error message so we can debug it. Right not it really hard to understand the exact issue. it just showing

Something went wrong ... We've noticed Internal Server Error while rendering this request.

If you need an assistance you can drop us a line on a contact page

glyphsharie commented 4 years ago

I am also trying to run it inside docker but I can't access it. Container is up and running. But when i load port 3000 in browser, it can't connect.

image image