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

Missing tsconfig.json:compilerOptions.rootDir makes dev-mode load commands from ./dist/ #716

Closed
salieri opened this issue Jun 19, 2023 · 0 comments · Fixed by #824
Closed

Comments

@salieri
Copy link

salieri commented Jun 19, 2023

Describe the bug
If compilerOptions.rootDir and compilerOptions.rootDirs options are omitted, tsPath defaults to dist/ -- even in dev mode.

To Reproduce

  1. npx oclif generate example
  2. Remove rootDir from tsconfig.json
  3. Run ./bin/dev some:command

Expected behavior
./bin/dev should be reading commands from ./src

Workaround
Add compilerOptions.rootDir into tsconfig.json

Environment (please complete the following information):

  • OS & version: MacOS Ventura 13.4
  • Shell/terminal & version zsh 5.9

Additional context
Our standard tsconfig.json configuration does not contain a compilerOptions.rootDir value. Instead, we have been relying on compilerOptions.baseUrl and compilerOptions.sourceRoot settings.

Until we realized what was going on with the rootDir, the developer experience was quite confusing -- we were definitely running in dev mode, but somehow the commands were loaded from ./dist. There were no warning messages either, so it wasn't all that intuitive to figure out what was going wrong.

Perhaps you could add some kind of a tsconfig.json sanity check to make sure that the fields you require to be present are present?

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

Successfully merging a pull request may close this issue.

1 participant