Skip to content

TypeError: Cannot read properties of undefined (reading 'endOffset') #12504

@lg-kialo

Description

@lg-kialo

Prettier 2.6.0
Playground link

--parser less

Input:

.background-gradient(@cut) {
    background: linear-gradient(
        to right,
        @white 0%,
        @white (@cut - 0.01%),
        @portal-background @cut,
        @portal-background 100%
    );
}

Output:

TypeError: Cannot read properties of undefined (reading 'endOffset')
    at v (https://prettier.io/lib/standalone.js:75:220)
    at w (https://prettier.io/lib/standalone.js:36:316)
    at https://prettier.io/lib/standalone.js:75:11235
    at https://prettier.io/lib/standalone.js:41:9097
    at u.each (https://prettier.io/lib/standalone.js:41:8932)
    at u.map (https://prettier.io/lib/standalone.js:41:9077)
    at Object.Ue [as print] (https://prettier.io/lib/standalone.js:75:10845)
    at F (https://prettier.io/lib/standalone.js:41:11582)
    at T (https://prettier.io/lib/standalone.js:41:11105)
    at https://prettier.io/lib/standalone.js:41:10991

Expected behavior:
Prettier doesn't break. Version 2.5.1 works fine.

Metadata

Metadata

Assignees

Labels

lang:lessIssues affecting Less-specific syntax (not plain CSS)status:needs investigationIssues that need additional investigation, e.g. to understand whether the reported behavior is a bug

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions