christianmalek / vuex-rest-api

A utility to simplify the use of REST APIs with Vuex
http://vuex-rest-api.org
MIT License
382 stars 48 forks source link

Strange case of double-promise in production #52

Closed wc-matteo closed 6 years ago

wc-matteo commented 6 years ago

While developing locally, this.$store.dispatch('...') returns a promise. When the code is in production, it returns a promise that returns a promise (I need to use await await this.$store.dispatch('...')). Any idea why that is?

christianmalek commented 6 years ago

I have no idea. Sorry.

christianmalek commented 6 years ago

Maybe I could help if you provide a code snippet.

wc-matteo commented 6 years ago

Thanks. I'll try to recreate a minimal repro.

wc-matteo commented 6 years ago

Discovered the cause:

Taking out "plugins": ["transform-runtime"] from .babelrc, makes production code have the double promise. (I removed the transform runtime, because I'm using babel polyfill)

christianmalek commented 6 years ago

Glad you found it. 👍