D
Deno

help

Deno dependency top level await work around

Wweegee12/6/2023
I have the following error while building with dnt
[dnt] Top level await cannot be used when distributing CommonJS/UMD (See deps/deno.land/x/sqlite@v3.2.1/mod.ts 16:1). Please re-organize your code to not use a top level await or only distribute an ES module by setting the 'scriptModule' build option to false.
[dnt] Top level await cannot be used when distributing CommonJS/UMD (See deps/deno.land/x/sqlite@v3.2.1/mod.ts 16:1). Please re-organize your code to not use a top level await or only distribute an ES module by setting the 'scriptModule' build option to false.
I cannot use top level await even with scriptModule: false, how do I workaround my dependency using it?
DDanielduel12/6/2023
Move your top level await to an async function and call it on start.
Wweegee12/7/2023
its not me who's doing it, its a dependency @Danielduel

Looking for more? Join the community!