Skip to content

Style path error in test configuration logs an obscure error message #24416

Closed

Description

@cexbrayat

Command

test

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

No response

Description

In a new project, replace styles.css by a file that does not exists:

- "styles": ["src/styles.css"],
+ "styles": ["src/error.css"],

then run ng test

Minimal Reproduction

https://stackblitz.com/edit/node-8w6owh?file=repro-style-error/angular.json

Run ng test

Exception or Error

❯ ng test
⠙ Generating browser application bundles (phase: setup)...AssertionError [ERR_ASSERTION] [ERR_ASSERTION]: Compilation cannot be undefined.
    at get (https://node8w6owh-vb42.w-corp.staticblitz.com/blitz.8cf5a3c77f45c942df800a39619ec49fff7e5814.js:6:292488)
    at AssertionError (https://node8w6owh-vb42.w-corp.staticblitz.com/blitz.8cf5a3c77f45c942df800a39619ec49fff7e5814.js:6:944835)
    at innerOk (https://node8w6owh-vb42.w-corp.staticblitz.com/blitz.8cf5a3c77f45c942df800a39619ec49fff7e5814.js:6:827492)
    at ok (https://node8w6owh-vb42.w-corp.staticblitz.com/blitz.8cf5a3c77f45c942df800a39619ec49fff7e5814.js:6:827616)
    at apply/webpackOptions.entry@file:///home/projects/node-8w6owh/repro-style-error/node_modules/ (angular-devkit/build-angular/src/webpack/plugins/styles-webpack-plugin.js:58:46)
    at <anonymous> (<anonymous>) {
  generatedMessage: false,
  code: 'ERR_ASSERTION',
  actual: undefined,
  expected: true,
  operator: '=='
}

Your Environment

Angular CLI: 15.0.3
Node: 16.14.2
Package Manager: npm 7.17.0
OS: linux x64

Angular: 15.0.3
... animations, cli, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1500.3
@angular-devkit/build-angular   15.0.3
@angular-devkit/core            15.0.3
@angular-devkit/schematics      15.0.3
@schematics/angular             15.0.3
rxjs                            7.5.7
typescript                      4.8.4

Anything else relevant?

No response

Activity

  1. added 2 commits that reference this issue on Dec 12, 2022
    63fca11
    d8a26cd
  2. self-assigned this
    on Dec 12, 2022
  3. added 3 commits that reference this issue on Dec 12, 2022
    7d256f8
    c92021b
    c28554e
  4. added 2 commits that reference this issue on Dec 12, 2022
    8fd0849
    ccc8e03
  5. angular-automatic-lock-bot commented on Jan 12, 2023

    @angular-automatic-lock-bot

    This issue has been automatically locked due to inactivity.
    Please file a new issue if you are encountering a similar or related problem.

    Read more about our automatic conversation locking policy.

    This action has been performed automatically by a bot.

  6. locked and limited conversation to collaborators on Jan 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions