Skip to content

confusing build error output #424

Description

@bleonar5

When I ran dnt build with "test" set to "true", I ended up getting the following error message no matter what I changed about my build configuration:

[dnt] Type checking ESM...
error TS2209: The project root is ambiguous, but is required to resolve export map entry '.' in file '/Users/brianleonard/psych-ds/clean/psychds-validator/npm/package.json'. Supply the `rootDir` compiler option to disambiguate.

Build failed with error: Error: Had 1 diagnostics.
    at getProgramAndMaybeTypeCheck (https://jsr.io/@deno/dnt/0.41.3/mod.ts:468:17)
    at build (https://jsr.io/@deno/dnt/0.41.3/mod.ts:354:17)
    at eventLoopTick (ext:core/01_core.js:168:7)
    at async file:///Users/brianleonard/psych-ds/clean/psychds-validator/build_npm.ts:36:5
Stack trace: Error: Had 1 diagnostics.
    at getProgramAndMaybeTypeCheck (https://jsr.io/@deno/dnt/0.41.3/mod.ts:468:17)
    at build (https://jsr.io/@deno/dnt/0.41.3/mod.ts:354:17)
    at eventLoopTick (ext:core/01_core.js:168:7)
    at async file:///Users/brianleonard/psych-ds/clean/psychds-validator/build_npm.ts:36:5

Eventually, I looked into the source code and realized that "rootDir" is not a valid compilerOption for dnt build, and that the actual value I needed to change was "rootTestDir".

This error message strikes me as very misleading, and personally led me to about half a day of hopeless debugging and frustration. I think the error message should do something to indicate that adding "rootTestDir" is the actual solution.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions