May 18, 2022 08:05 AM
Hi, I am super new to Airtable scripts and I am stuck with trying to fix this error. It looks like I need to add the topLevelAwait
module somewhere, but not sure where.
So far what I did was to install the Hello-World
app in my localhost
and then replaced the contents of index.js with the contents of the [YouTube Example Script](https://airtable.com/marketplace/scraGQUFvORtvmHC5/import-youtube-analytics)
since it does similar things to what I need and I would like to learn from it.
The issue is that when I do a block release
I am getting:
ModuleParseError: Module parse failed: The top-level-await experiment is not enabled (set experiments.topLevelAwait: true to enabled it)
File was processed with these loaders:
* ../../../../usr/local/lib/node_modules/@airtable/blocks-cli/node_modules/babel-loader/lib/index.js
You may need an additional loader to handle the result of these loaders.
Any help will be appreciated,
Thanks in advance!
Solved! Go to Solution.
May 18, 2022 06:30 PM
What you’ve linked is a script, but the error and other info you shared in your original post are related to custom apps. In short, you followed the instructions for creating a custom app, not installing a script.
To use the script that you found, just click the “Add Script” button on that page you linked. It’ll ask you for a base where you want it added, and it will automatically add the Scripting app and insert the code into it.
May 18, 2022 10:20 AM
Running into the same problem. I can’t find anything else on topLevelAwait
that’s explicitly related to Airtable, so must be a package that changed recently.
May 18, 2022 03:37 PM
Welcome to the Airtable community!
Are you creating a script or a custom app?
It looks like you are trying to create a custom app. However, if you are new to scripting, creating a custom app might be a really big leap.
May 18, 2022 06:05 PM
It is my understanding it is just a script not an app. I need to create a similar behavior to the script in the link.
Thanks!
May 18, 2022 06:30 PM
What you’ve linked is a script, but the error and other info you shared in your original post are related to custom apps. In short, you followed the instructions for creating a custom app, not installing a script.
To use the script that you found, just click the “Add Script” button on that page you linked. It’ll ask you for a base where you want it added, and it will automatically add the Scripting app and insert the code into it.
May 19, 2022 06:36 AM
you are totally right, that was the issue! thanks for pointing that out!
May 19, 2022 03:28 PM
Cool! So for those of us who are building an app, has anyone encountered this and discovered a way to enable topLevelAwait
?
May 19, 2022 08:29 PM
Sorry, but I haven’t had the time to work on custom apps for a while, and I haven’t even heard of this top-level-await
feature. After a quick search, it turns out that it’s not Airtable-specific. I’ll let this page explain further:
If you want to go beyond that, my gut says that your favorite search engine should turn up enough info.
May 20, 2022 02:26 PM
I’m familiar with the feature top-level-await
, its usage, and its caveats! I was just hoping someone else here had tried it specifically with Airtable apps. I guess the answer is no. Thank you.
May 20, 2022 05:05 PM
It’s only been two days since the initial post. I’d give it a bit more time before assuming that nobody here has used top-level-await with a custom Airtable app. (That said, this post will auto-close in three days because an earlier comment was marked as the solution, so it might be worth starting a new thread on this topic to keep the discussion going.)