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

Cannot read properties of undefined (reading 'paths') when the base config doesn't include that option #23379

Open
1 of 4 tasks
hrajchert opened this issue May 14, 2024 · 0 comments

Comments

@hrajchert
Copy link

Current Behavior

I've refactored my typescript configuration from using a base file called tsconfig.json to tsconfig-base.json and suddenly running the build fails with the error Cannot read properties of undefined (reading 'paths')

I've tracked the error down to this code where there are two main issues:

  1. if the file is found (it is, I do have a new main tsconfig.json) but it doesn't have compilerOptions it fails with a null exception
  2. The file that is looking is hardcoded to be tsconfig.json or tsconfig.base.json

Expected Behavior

  • If the config file exits and it doesn't have a compilerOption it should default the paths to an empty array.
  • That base config file should not be hardcoded and it should be passed as a configuration parameter, as I was planning to have different bases for different purposes.

GitHub Repo

private repo

Steps to Reproduce

  1. reproduce not available as it is a private repo

Nx Report

Node   : 18.16.0
   OS     : darwin-arm64
   yarn   : 3.5.0
   
   nx             : 17.2.8
   @nx/js         : 17.2.8
   @nx/jest       : 17.2.8
   @nx/linter     : 17.2.8
   @nx/eslint     : 17.2.8
   @nx/workspace  : 17.2.8
   @nx/devkit     : 17.2.8
   @nx/node       : 17.2.8
   @nx/plugin     : 17.2.8
   @nrwl/tao      : 17.2.8
   typescript     : 5.2.2
   ---------------------------------------
   Local workspace plugins:
         @***/mobile-plugin
         @***/docker

Failure Logs

No response

Package Manager Version

npm 9.5.1

Operating System

  • macOS
  • Linux
  • Windows
  • Other (Please specify)

Additional Information

No response

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

No branches or pull requests

3 participants