denoland / denoland/dnt

dnt Build Issues

Open
#330 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
1.3k
Forks
49
PR merge metrics
No merged PRs in 30d

Description

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?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.