Forum Discussion
Can't get async / wait to work in any form or shape within a custom viz
- 6 years ago
Hi Schizzomarino,
Your code is definitely okay. Your issue appears to be with Webpack and no further configuration is required from creating a new visual other than ensuring that you have regenerator-runtime as a dependent package and referenced in your visual.ts.
I've made a simple Git repo that you can clone and take a look at if you want to validate or see any differences to your code, and I'll link the sections of code as prescribed. Essentially, you just need to do the following:
- Run npm i regenerator-runtime from the console so your dependencies are updated.
- In visual.ts, add import "regenerator-runtime/runtime"; underneath the import "core-js/stable"; statement.
I now get the following in my console with your code:
Hopefully this gets you moving though. Good luck!
Daniel
Hi Schizzomarino,
Your code is definitely okay. Your issue appears to be with Webpack and no further configuration is required from creating a new visual other than ensuring that you have regenerator-runtime as a dependent package and referenced in your visual.ts.
I've made a simple Git repo that you can clone and take a look at if you want to validate or see any differences to your code, and I'll link the sections of code as prescribed. Essentially, you just need to do the following:
- Run npm i regenerator-runtime from the console so your dependencies are updated.
- In visual.ts, add import "regenerator-runtime/runtime"; underneath the import "core-js/stable"; statement.
I now get the following in my console with your code:
Hopefully this gets you moving though. Good luck!
Daniel
Oh wow, thanks so much for this Daniel!
Worked like a charm!
Now to start using generator functions right? 😄