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

No source of warning on SCSS files #27726

Closed
1 task done
Delagen opened this issue May 27, 2024 · 1 comment · Fixed by #27732
Closed
1 task done

No source of warning on SCSS files #27726

Delagen opened this issue May 27, 2024 · 1 comment · Fixed by #27732
Labels
area: @angular/build freq1: low Only reported by a handful of users who observe it rarely severity3: broken type: bug/fix

Comments

@Delagen
Copy link

Delagen commented May 27, 2024

Command

build, serve

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

Webpack Builder

Description

When using new ESBuild based builder cannot find source of warning in console

ESBuild output

For component styles

[WARNING] <warning text> [plugin angular-sass]

For global styles

[WARNING] <warning text> [plugin angular-sass]
    angular:styles/global:styles:1:8:
      1 │ @import 'src/styles.scss';
        ╵         ~~~~~~~~~~~~~~~~~

Webpack output

For component styles

./src/.../some.component.scss?ngResource - Warning: Module Warning (from ./node_modules/sass-loader/dist/cjs.js):
<warning text>
<source file path> <line>:<pos>  context function()
... <all stack>
src/.../some.component.scss <line>:<pos>  root stylesheet

For global styles

./src/styles.scss - Warning: Module Warning (from ./node_modules/sass-loader/dist/cjs.js):
<warning text>
<source file path> <line>:<pos> context function()
... <all stack>
src/styles.scss <line>:<pos> root stylesheet

Minimal Reproduction

Any project with specified build system

place anywhere in component stylesheet file or imported file into global stylesheet

@warn 'some message';

Build

Exception or Error

No response

Your Environment

_                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/
    

Angular CLI: 17.3.7
Node: 20.13.1
Package Manager: npm 10.8.0
OS: win32 x64

Angular: 17.3.9
... animations, cdk, common, core, elements, forms, localize
... platform-browser, platform-browser-dynamic, platform-server
... router, service-worker

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1703.7
@angular-devkit/build-angular   17.3.7
@angular-devkit/core            17.3.7
@angular-devkit/schematics      17.3.7
@angular/cli                    17.3.7
@angular/pwa                    17.3.7
@schematics/angular             17.3.7
rxjs                            7.8.1
typescript                      5.4.5
webpack                         5.91.0
zone.js                         0.14.5

Anything else relevant?

No response

alan-agius4 added a commit to alan-agius4/angular-cli that referenced this issue May 28, 2024
When using the `@warn` directive, the `span` entry in the warning object is often undefined. Instead, the `stack` property is populated.

```json
{
  "warnings": [
    {
      "deprecation": false,
      "deprecationType": null,
      "span": undefined,
      "stack": "projects/foo/src/app/app.component.scss 1:1  root stylesheet\n",
      "message": "some message"
    }
  ]
}
```

### Before
```
▲ [WARNING] some message [plugin angular-sass]
```

### Now
```
▲ [WARNING] some message [plugin angular-sass]

  projects/foo/src/app/app.component.scss 1:1  root stylesheet
```

Closes: angular#27726
alan-agius4 added a commit to alan-agius4/angular-cli that referenced this issue May 28, 2024
When using the `@warn` directive, the `span` entry in the warning object is often undefined. Instead, the `stack` property is populated.

```json
{
  "warnings": [
    {
      "deprecation": false,
      "deprecationType": null,
      "span": undefined,
      "stack": "projects/foo/src/app/app.component.scss 1:1  root stylesheet\n",
      "message": "some message"
    }
  ]
}
```

### Before
```
▲ [WARNING] some message [plugin angular-sass]
```

### Now
```
▲ [WARNING] some message [plugin angular-sass]

  projects/foo/src/app/app.component.scss 1:1  root stylesheet
```

Closes: angular#27726
alan-agius4 added a commit to alan-agius4/angular-cli that referenced this issue May 28, 2024
When using the `@warn` directive, the `span` entry in the warning object is often undefined. Instead, the `stack` property is populated.

```js
{
  "warnings": [
    {
      "deprecation": false,
      "deprecationType": null,
      "span": undefined,
      "stack": "projects/foo/src/app/app.component.scss 1:1  root stylesheet\n",
      "message": "some message"
    }
  ]
}
```

### Before
```
▲ [WARNING] some message [plugin angular-sass]
```

### Now
```
▲ [WARNING] some message [plugin angular-sass]

  projects/foo/src/app/app.component.scss 1:1  root stylesheet
```

Closes: angular#27726
@alan-agius4 alan-agius4 added type: bug/fix freq1: low Only reported by a handful of users who observe it rarely severity3: broken area: @angular/build labels May 28, 2024
alan-agius4 added a commit that referenced this issue May 28, 2024
When using the `@warn` directive, the `span` entry in the warning object is often undefined. Instead, the `stack` property is populated.

```js
{
  "warnings": [
    {
      "deprecation": false,
      "deprecationType": null,
      "span": undefined,
      "stack": "projects/foo/src/app/app.component.scss 1:1  root stylesheet\n",
      "message": "some message"
    }
  ]
}
```

### Before
```
▲ [WARNING] some message [plugin angular-sass]
```

### Now
```
▲ [WARNING] some message [plugin angular-sass]

  projects/foo/src/app/app.component.scss 1:1  root stylesheet
```

Closes: #27726
alan-agius4 added a commit that referenced this issue May 28, 2024
When using the `@warn` directive, the `span` entry in the warning object is often undefined. Instead, the `stack` property is populated.

```js
{
  "warnings": [
    {
      "deprecation": false,
      "deprecationType": null,
      "span": undefined,
      "stack": "projects/foo/src/app/app.component.scss 1:1  root stylesheet\n",
      "message": "some message"
    }
  ]
}
```

### Before
```
▲ [WARNING] some message [plugin angular-sass]
```

### Now
```
▲ [WARNING] some message [plugin angular-sass]

  projects/foo/src/app/app.component.scss 1:1  root stylesheet
```

Closes: #27726
(cherry picked from commit 4a879a9)
celestius0 pushed a commit to celestius0/angular-cli that referenced this issue Jun 5, 2024
When using the `@warn` directive, the `span` entry in the warning object is often undefined. Instead, the `stack` property is populated.

```js
{
  "warnings": [
    {
      "deprecation": false,
      "deprecationType": null,
      "span": undefined,
      "stack": "projects/foo/src/app/app.component.scss 1:1  root stylesheet\n",
      "message": "some message"
    }
  ]
}
```

### Before
```
▲ [WARNING] some message [plugin angular-sass]
```

### Now
```
▲ [WARNING] some message [plugin angular-sass]

  projects/foo/src/app/app.component.scss 1:1  root stylesheet
```

Closes: angular#27726
@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 Jun 28, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: @angular/build freq1: low Only reported by a handful of users who observe it rarely severity3: broken type: bug/fix
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants