Upgrading to Angular 14

Trevor Karjanis · October 13, 2022

This guide is specific to upgrading from Angular 12 to 14. It should be completed before building and running tests.

Prerequisites

Angular 14 will not work with libraries built with 12 due to changes for the standalone component feature.

error TS2314: Generic type 'ɵɵDirectiveDeclaration' requires 6 type argument(s).

Upgrade Steps

  1. Complete the general upgrade guide.
  2. If the workspace has libraries, configure them to compile in partial mode by adding the following to tsconfig.lib.json.
     "angularCompilerOptions": {
       "compilationMode": "partial"
     }
    
  3. If the workspace CI pipeline supports it, enable the build cache for CI by running the following. The cache is enabled for local development by default.
     ng config cli.cache.environment all
    
  4. Remove defaultCollection from angular.json and, run the following. defaultCollection is deprecated.
     ng config cli.schematicCollections "[\"<default-schematic>\"]"
    
  5. If the workspace has a projects directory, ensure scripts in package.json specify the project name. defaultProject has been deprecated.
  6. Remove all tilde (~) prefixes from SCSS imports in style files.

Twitter, Facebook