Skip to content

[postcss-custom-properties] TypeError: Cannot read properties of undefined (reading 'nodes') #870

@Hypnosphi

Description

@Hypnosphi

Reproduction link

https://github.com/Hypnosphi/postcss-custom-properties-repro

Bug description

Postcss crashes with an exception

Actual Behavior

No response

Expected Behavior

No response

Can you reproduce it with npx @csstools/csstools-cli <plugin-name> minimal-example.css?

Yes

npx Output

given the following css

.grid {
    --column-width: auto;
    --first-column: [start] var(--column-width);

    grid-template-columns: var(--first-column) auto;
}

the output is

Cannot read properties of undefined (reading 'nodes')

Inlining any of the vars or moving [start] fixes the issue

Extra config

No response

What plugin are you experiencing this issue on?

PostCSS Custom Properties

Plugin version

13.1.3

What OS are you experiencing this on?

macOS

Node Version

18.13.0

Validations

  • Follow our Code of Conduct
  • Check that there isn't already an issue that request the same feature to avoid creating a duplicate.

Would you like to open a PR for this bug?

  • I'm willing to open a PR

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions