skip to Main Content

I integrated vue store front with magento 2, frontend works fine but product images not display in frontend. It throws error Unable to compile TypeScript:nsrc/image/action/local/index.ts(27,18): error TS2339: Property ‘query’ does not exist on type ‘Request<any, any, any, any>’. imagemagick is also installed and imgurl in local.json is also defined.

Anyone please know about this why error display.

2

Answers


  1. It is about this.req which is typeof Request from express – it has query property. Please make sure you have yarn.lock from the original repo and reinstall dependencies.

    If you are using docker, you might need to add:
    - './yarn.lock/var/www/yarn.lock'
    To volumes section in the docker-compose.nodejs.yml

    Login or Signup to reply.
  2. i have found a simple solution you can try that

    copy all your magento 2 pub/media data in vue-storefront-api/var/magento-folder/pub/media
    Or
    create a symlink if you are working on localhost

    vue-storefront-api/config/local.json

    "magento2": {
    "imgUrl": "http://magento-domain/pub/media/catalog/product&quot;,
    "assetPath": "/../var/magento-folder/pub/media",
    }

    vue-storefront/config/local.json

    "images": {
    "useExactUrlsNoProxy": false,
    "baseUrl": "http://localhost:8080/img/&quot;,
    "useSpecificImagePaths": false,
    "paths": {
    "product": "/catalog/product"
    },
    "productPlaceholder": "/assets/placeholder.jpg"
    },

    run command in vue-storefront and vue-storefront-api

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search