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

confusing build error output #424

Open
bleonar5 opened this issue Aug 14, 2024 · 0 comments
Open

confusing build error output #424

bleonar5 opened this issue Aug 14, 2024 · 0 comments

Comments

@bleonar5
Copy link

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.

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

1 participant