Skip to content

Conversation

@alan-agius4
Copy link
Collaborator

@alan-agius4 alan-agius4 commented May 28, 2024

When using the @warn directive, the span entry in the warning object is often undefined. Instead, the stack property is populated.

{
  "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

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 action: review The PR is still awaiting reviews from at least one requested reviewer target: patch This PR is targeted for the next patch release labels May 28, 2024
@alan-agius4 alan-agius4 requested a review from clydin May 28, 2024 09:50
@clydin
Copy link
Member

clydin commented May 28, 2024

This seems like a bug on the Sass side. If it can generate a stack trace, it knows the location or is it always at 1:1 in this case?
Maybe add a comment that this is a workaround for a lack of a warning location?

@alan-agius4
Copy link
Collaborator Author

This seems like a bug on the Sass side. If it can generate a stack trace, it knows the location or is it always at 1:1 in this case? Maybe add a comment that this is a workaround for a lack of a warning location?

It knows the location.

@alan-agius4 alan-agius4 added action: merge The PR is ready for merge by the caretaker and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels May 28, 2024
@alan-agius4 alan-agius4 merged commit 4a879a9 into angular:main May 28, 2024
@alan-agius4 alan-agius4 deleted the scss-warn branch May 28, 2024 11:03
@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

action: merge The PR is ready for merge by the caretaker target: patch This PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

No source of warning on SCSS files

2 participants