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

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

Closed
1 task
cexbrayat opened this issue Dec 12, 2022 · 1 comment · Fixed by #24418
Closed
1 task

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

cexbrayat opened this issue Dec 12, 2022 · 1 comment · Fixed by #24418

Comments

@cexbrayat
Copy link
Member

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

alan-agius4 added a commit to alan-agius4/angular-cli that referenced this issue Dec 12, 2022
…n style does not exist in Karma builder

Prior to this change the the error was not displayed correctly due to compilation being undefined.

Closes angular#24416
alan-agius4 added a commit to alan-agius4/angular-cli that referenced this issue Dec 12, 2022
…tyle does not exist in Karma builder

Prior to this change the the error was not displayed correctly due to compilation being undefined.

Closes angular#24416
@alan-agius4 alan-agius4 self-assigned this Dec 12, 2022
alan-agius4 added a commit to alan-agius4/angular-cli that referenced this issue Dec 12, 2022
…tyle does not exist in Karma builder

Prior to this change the the error was not displayed correctly due to compilation being undefined.

Closes angular#24416
alan-agius4 added a commit to alan-agius4/angular-cli that referenced this issue Dec 12, 2022
…tyle does not exist in Karma builder

Prior to this change the the error was not displayed correctly due to compilation being undefined.

Closes angular#24416
alan-agius4 added a commit to alan-agius4/angular-cli that referenced this issue Dec 12, 2022
…tyle does not exist in Karma builder

Prior to this change the the error was not displayed correctly due to compilation being undefined.

Closes angular#24416
angular-robot bot pushed a commit that referenced this issue Dec 12, 2022
…tyle does not exist in Karma builder

Prior to this change the the error was not displayed correctly due to compilation being undefined.

Closes #24416
angular-robot bot pushed a commit that referenced this issue Dec 12, 2022
…tyle does not exist in Karma builder

Prior to this change the the error was not displayed correctly due to compilation being undefined.

Closes #24416

(cherry picked from commit 8fd0849)
@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Jan 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
2 participants