Skip to content

Root.source is missing end value #1870

@romainmenke

Description

@romainmenke

this.root.source = { input, start: { column: 1, line: 1, offset: 0 } }

This normally isn't an issue but when creating new nodes and adopting source it can lead to broken source maps.

My case :

  • run PostCSS on a separate file
  • rewrite parts of the AST
  • new nodes are given the source property from the Root node

The end result is a broken source map that contains <no source>

Relevant code in the map generator: https://github.com/postcss/postcss/blob/main/lib/map-generator.js#L167-L181

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions