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
async+destructuring: Cannot read property '0' of null #4759
Comments
might be your combination of plugins/presets - it works in the repl |
It appears to be an issue with transform-regenerator:
|
Ah you're right. Definitely a bug but the workaround your particular case is that you can use the https://babeljs.io/docs/plugins/transform-async-to-generator/ transform since the env is node 6 |
Yep, that works. |
A variant of this bug is const dispatch = async id => ({ id })
export const getId = async () => {
const { id } = await dispatch(42)
return id
} which throws the error In this particular case the problem seems to be that it tries to treat an |
Is this a bug with babel/babel-plugin-transform-regenerator's use of regenerator-transform, or solely with the latter? Just wondering if this needs to be re-filed over at: Also, is there an issue filed already for improving the error messages in cases like these? The current |
Hi, I encountered this bug as well. I need to transform generator as my code is going to go on front end clients. |
Are there any updates to this? I believe I'm running into a similar issue.
|
Removing
async
keyword: compiles.Removing destructuring assignment: compiles.
The text was updated successfully, but these errors were encountered: