Vendic / vsf-external-checkout

VueStorefront External Checkout module
MIT License
25 stars 10 forks source link

VS crash in production mode (build and start) with external-checkout #12

Open RoberFer06 opened 5 years ago

RoberFer06 commented 5 years ago

I'm trying to build Vue Storefront in production mode (build and start), but there is some problem with external-checkout library. Build and start are successful but when I open it in the browser it doesn't work Untitled

It is only in production mode (build and start) , In dev mode (yarn dev) it works good.

The steps for install the library was download the laster version, copy it into modules folder, add module in modules/index.ts and add checkout url in config/local.js

Vue Storefront version 1.9.1 node js v8.11.4 yarn run v1.9.4

Could you help me with that, please ?

RoberFer06 commented 5 years ago

This is the console log

image

0|server | 2019-06-13 14:21:09: TypeError: Cannot use 'in' operator to search for '' in undefined 0|server | at beforeEach (server-bundle.js:1:396939) 0|server | at iterator (/var/www/pikapp/vue-storefront/node_modules/vue-router/dist/vue-router.common.js:1937:7) 0|server | at step (/var/www/pikapp/vue-storefront/node_modules/vue-router/dist/vue-router.common.js:1711:9) 0|server | at /var/www/pikapp/vue-storefront/node_modules/vue-router/dist/vue-router.common.js:1712:11 0|server | at /var/www/pikapp/vue-storefront/node_modules/vue-router/dist/vue-router.common.js:1958:11 0|server | at beforeEach (server-bundle.js:1:369593) 0|server | at iterator (/var/www/pikapp/vue-storefront/node_modules/vue-router/dist/vue-router.common.js:1937:7) 0|server | at step (/var/www/pikapp/vue-storefront/node_modules/vue-router/dist/vue-router.common.js:1711:9) 0|server | at /var/www/pikapp/vue-storefront/node_modules/vue-router/dist/vue-router.common.js:1712:11 0|server | at /var/www/pikapp/vue-storefront/node_modules/vue-router/dist/vue-router.common.js:1958:11

Tjitse-E commented 5 years ago

Hi @RoberFer06, thanks for opening up an issue.

I've checked the issue on a new instance of VueStorefront 1.9.1, but I don't get anything simailar. Does everything work correctly if you just run yarn dev?

I've got this setting in the local.json:

    "externalCheckout": {
      "cmsUrl" : "https://yourcmsaddress.com"
    },

So when I go to /checkout i'm redirected to https://yourcmsaddress.com/vue/cart/sync/token//cart/VLP4QFk8Z96MSPSZjaDxij10TyAcRA0m, which is the correct behaviour.

RoberFer06 commented 5 years ago

Hi @Tjitse-E. Everything works correctly when I run yarn dev, the problem is only in production, when I run yarn build. The problem already happen when I open homepage or any page, it make a infinite redirect to page-not-found, and in the console log what I see is what I put above

When I coment the library and rebuild proyect, everithing works fine again.

Also I tried previous versions (the previous versions correcting the bug /store for /core/store), but the problem is the same.

I just made it work with this version vsf-external-checkout": "1.0.6,the version that is archived, and VueStorefront 1.8.1.

RoberFer06 commented 5 years ago

I could not make it work

fayjusss commented 4 years ago

I faced the same issue when I ran yarn dev. I believe it occurs when multistoreEnabled is true but in config/externalCheckout stores are not defined.

antonioglass commented 3 years ago

Exactly! Have you solved it? If so, how?