Skip to content

Module resolution is not updated for tsconfigs not specified in a project.json file #33705

@nudge-alec-robertson

Description

@nudge-alec-robertson

Current Behavior

When running the update-21-2-0/update-module-resolution migration, tsconfigs are not updated if they are not specified in a project.json file.

Expected Behavior

All tsconfigs should be updated.

GitHub Repo

No response

Steps to Reproduce

  1. Add a library, e.g. an Angular library, that is not buildable
  2. Run update-21-2-0/update-module-resolution migration
  3. Notice that tsconfigs are not updated if the tsconfig is not in a project.json, including the library added in step one

Nx Report

Node           : 24.11.1
OS             : win32-x64
Native Target  : x86_64-windows
npm            : 11.6.2

nx (global)            : 22.1.3
nx                     : 22.1.3
@nx/js                 : 22.1.3
@nx/jest               : 22.1.3
@nx/eslint             : 22.1.3
@nx/workspace          : 22.1.3
@nx/angular            : 22.1.3
@nx/cypress            : 22.1.3
@nx/devkit             : 22.1.3
@nx/eslint-plugin      : 22.1.3
@nx/module-federation  : 22.1.3
@nx/rspack             : 22.1.3
@nx/storybook          : 22.1.3
@nx/web                : 22.1.3
@nx/webpack            : 22.1.3
typescript             : 5.9.3
---------------------------------------
Community plugins:
@jsverse/transloco : 7.6.1
@storybook/angular : 10.1.4
---------------------------------------
Cache Usage: 0.00 B / 47.63 GB

Failure Logs

Package Manager Version

No response

Operating System

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

Additional Information

I believe the current migration only looks at tsconfigs if they are specified in a project.json. However this only covers test tsconfigs for libraries that are not buildable. Libraries that are not buildable should have all relevant tsconfigs updated.

This is an issue because when using Storybook, any references to storybook as imports stop working, with an error "Cannot find module '@storybook/angular' or its corresponding type declarations.". The tsconfig.lib.json/tsconfig.json used for these imports has not been updated.

As soon as the update is manually applied, the error goes away. However, for an application with dozens of libraries, this cannot easily be done manually. I believe the existing migration should have already covered this use case.

Metadata

Metadata

Assignees

Labels

priority: highHigh Priority (important issues which affect many people severely)scope: angularIssues related to Angular support in Nxtype: bug

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions