question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`@layer` rules that do not have a block and do not have a trailing semi-colon break sourcemaps

See original GitHub issue
@layer extensions {
  @layer one, two
}

This is equivalent to:

@layer extensions.one, extensions.two;

It parses correctly but fails to write a sourcemap :

Invalid mapping: {"generated":{"line":3,"column":-1},"source":"a.css","original":{"line":2,"column":16},"name":null}

The error goes away when I add a trailing semi-colon :

@layer extensions {
  @layer one, two;
}

I don’t have any knowledge about sourcemap internals and failed to pinpoint where it is going wrong.

I did add some tests to reproduce this : https://github.com/postcss/postcss/pull/1801

I don’t think the parsing the test is needed but I wanted to see how it was parsed. Maybe I am overlooking something there.

Issue Analytics

  • State:closed
  • Created 10 months ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
aicommented, Dec 11, 2022

The fix was released at 8.4.20.

1reaction
aicommented, Dec 4, 2022

Thanks for the issue with a lot of details.

I will fix it. But very likely that I will do it after my vacation week later.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Are Webpack SASS Source-maps Broken? - Stack Overflow
EDIT: I'm usinge devtool: 'source-map' in production and devtool: 'cheap-eval-source-map' in development. I don't fully understand the forces at ...
Read more >
stylelint/CHANGELOG.md at main - GitHub
A mighty, modern linter that helps you avoid errors and enforce conventions in your styles. - stylelint/CHANGELOG.md at main · stylelint/stylelint.
Read more >
4 Reasons Why Your Source Maps are Broken - Sentry Blog
This likely means that your source map doesn't contain or link to your original source files. Without your original source files, you're still ......
Read more >
Safari Technology Preview Release Notes - Apple Developer
Updates to Safari Technology Preview are no longer available for macOS Big Sur. If you already have Safari Technology Preview installed, you can...
Read more >
SourceMapDevToolPlugin - webpack
This plugin enables more fine grained control of source map generation. ... the output filename of the SourceMap (will be inlined if no...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found