Vue-styleguidist: async functions causing build error

Created on 28 Mar 2018  路  6Comments  路  Source: vue-styleguidist/vue-styleguidist

Hey there,

i've read that there should be async support included. We currently facing the following issue:
A method:

test: async function () {
 return await Promise.resolve(1)
}

causes the following bug:

Cannot parse src/components/Carousel/Carousel.vue: ReferenceError: regeneratorRuntime is not defined

It usually means that vue-docgen-api does not understand your source code or when using third-party libraries, try to file an issue here:
https://github.com/vue-styleguidist/vue-docgen-api/issues

We also using Vue-Touch (hammer.js), but that error can be reproduced on any other component by just adding that test method to it.
Please help, we want our awesome Carousel to be documented :)

Most helpful comment

@bwcgn did you ever solve this issue? I have the same error, it's somehow not configuring babel correctly.

All 6 comments

Hi @bwcgn,

I tried to replicate this issue, but I couldn't,

Please share a little demo to fix it.

Regards!

Hey @rafaesc

I've created a repo (https://github.com/bwcgn/vue-styleguidist-test) but it seems to work in that environment. I guess the project Babel is messing around with some stuff. If you have any other hint, what might cause this, I'm open for any hints :)

@bwcgn did you ever solve this issue? I have the same error, it's somehow not configuring babel correctly.

doesn't work for me neither.

<script>
export default {
    methods: {
         async save() {};
    }
}
</script>

nodejs 10.11

This snippet throws that messages.

Christ I just spent 7 hours on this so hear my wisdom (actually not mine but the one from https://github.com/styleguidist/react-styleguidist/issues/162#issuecomment-386014638):

//styleguide.config.js
module.exports = {
  // ... other props unimportant to this answer here
  require: ['regenerator-runtime/runtime']
}

It's 2 AM i'm going to bed

@3nuc thank you for posting your answer!
You are awesome and I am sure it will help other devs a ton.

Was this page helpful?
0 / 5 - 0 ratings