vue-live
vue-live copied to clipboard
Transforming async functions is not implemented. Use `transforms: { asyncAwait: false }` to skip transformation and disable this error.
Hi,
My template (SFC) has async functions but I get this error:
Transforming async functions is not implemented. Use
transforms: { asyncAwait: false }to skip transformation and disable this error.
There seems to be a fix here https://github.com/vue-styleguidist/vue-styleguidist/issues/741 but I am confused as how I could force vue-live to use a custom styleguide.config.js config file or pass the option ?
Also see regarding Buble: https://github.com/facebook/docusaurus/pull/3954
Ok found out the solution which is super simple: we just need to pass the corresponding buble config in Preview.vue:
const renderedComponent = compileScript(
code,
this.jsx
? { jsx: "__pragma__(h)", objectAssign: "__concatenate__", transforms: {asyncAwait: false}}
: {transforms: {asyncAwait: false}}
);
THank you @enodr great research Would you make a quick PR?
it seems to have been fixed...
https://github.com/vue-styleguidist/vue-live/blob/3c35891c367ea873834ec36105e9e2e64f511efd/src/Preview.vue#L137-L146