Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transforming async functions is not implemented. Use transforms: { asyncAwait: false } to skip transformation and disable this error. #68

Closed
enodr opened this issue Sep 30, 2021 · 4 comments

Comments

@enodr
Copy link
Contributor

enodr commented Sep 30, 2021

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 vue-styleguidist/vue-styleguidist#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 ?

@enodr
Copy link
Contributor Author

enodr commented Sep 30, 2021

Also see regarding Buble: facebook/docusaurus#3954

@enodr
Copy link
Contributor Author

enodr commented Sep 30, 2021

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}}
        );

@elevatebart
Copy link
Member

THank you @enodr great research
Would you make a quick PR?

@elevatebart
Copy link
Member

it seems to have been fixed...

vue-live/src/Preview.vue

Lines 137 to 146 in 3c35891

const renderedComponent = compileScript(
code,
this.jsx
? {
jsx: "__pragma__(h)",
objectAssign: "__concatenate__",
transforms: { asyncAwait: false },
}
: { transforms: { asyncAwait: false } }
);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants