React-styleguidist: Compilation error on using 'async' and 'await' in readme.md

Created on 20 May 2019  路  3Comments  路  Source: styleguidist/react-styleguidist

Current behavior

When using async functions in readme.md then getting compilation error, before upgrading to 9.x.x it was working fine.
Error :-
image

Simplified code :-
image

To reproduce
Just try to use async functions in readme.md, it can be easily replicated.

Expected behavior


It should compile perfectly as it doing for 8.x.x

good first issue help wanted released

Most helpful comment

The error explanation

We have the error here because styleguidinst has updated version of bubl茅 (from v0.9.4 to v0.9.7) which does actual code transformation.
In latest version of bubl茅 they throw this error because right now bubl茅 cannot transpile async, so they've added a special transform option called asyncAwait to pass async through as before. Here the code, how they do it: example

It has been working before because bubl茅 just passed async through.
Right now it throws the error, but you are able to confgure bubl茅 to pass async through without transformation by using compilerConfig in your styleguide.config.js.
Like this:

  compilerConfig: {
    transforms: { asyncAwait: false }
  }

It also makes sence to pass default styleguidinst options for compilerConfig (code), as documentation about default options is outdated.

Questions

@sapegin Should we add transforms: { asyncAwait: false } for default compilerConfig to make async/await work by default?
Does it make sense to update compilerConfig documentation to add there all current default options?

All 3 comments

Feel free to send a pull request with a fix.

The error explanation

We have the error here because styleguidinst has updated version of bubl茅 (from v0.9.4 to v0.9.7) which does actual code transformation.
In latest version of bubl茅 they throw this error because right now bubl茅 cannot transpile async, so they've added a special transform option called asyncAwait to pass async through as before. Here the code, how they do it: example

It has been working before because bubl茅 just passed async through.
Right now it throws the error, but you are able to confgure bubl茅 to pass async through without transformation by using compilerConfig in your styleguide.config.js.
Like this:

  compilerConfig: {
    transforms: { asyncAwait: false }
  }

It also makes sence to pass default styleguidinst options for compilerConfig (code), as documentation about default options is outdated.

Questions

@sapegin Should we add transforms: { asyncAwait: false } for default compilerConfig to make async/await work by default?
Does it make sense to update compilerConfig documentation to add there all current default options?

:tada: This issue has been resolved in version 9.1.5 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

Was this page helpful?
0 / 5 - 0 ratings