Skip to content
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

dnt Build Issues #330

Open
mcgear opened this issue Aug 10, 2023 · 2 comments
Open

dnt Build Issues #330

mcgear opened this issue Aug 10, 2023 · 2 comments

Comments

@mcgear
Copy link

mcgear commented Aug 10, 2023

Hopefully I am missing something simple. We have the dnt builds working in other libraries, but for some reason I can't get it to work in our new icons library: https://github.com/fathym-deno/atomic-icons

We have defined our dnt build in the ./scripts/npm.build.ts file, but we are getting the following error:

[dnt] Top level await cannot be used when distributing CommonJS/UMD (See deps/deno.land/x/fresh@1.3.1/src/server/build_id.ts 6:21). 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.
error: Uncaught (in promise) Error: Build failed due to top level await when creating CommonJS/UMD package.
        throw new Error(
              ^
    at build (https://deno.land/x/dnt@0.38.0/mod.ts:334:15)
    at eventLoopTick (ext:core/01_core.js:183:11)
    at async file:///C:/Users/micha_8ygdgy8/Fathym/OpenSource/fathym-deno/atomic-icons/scripts/npm.build.ts:5:1

Based on the error, it appears as though it is trying to treat npm.build.ts as the entrypoint. What am i missing in this project to get it to work?

@mcgear
Copy link
Author

mcgear commented Aug 10, 2023

@zifeo
Copy link

zifeo commented Sep 30, 2023

@mcgear You seems to have a top level await in your library, use scriptModule: false in dnt.build as suggested by the error message and you should be good (see here).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants