Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
lg-kialo opened this issue Mar 21, 2022 · 3 comments · Fixed by #12536
Closed

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

lg-kialo opened this issue Mar 21, 2022 · 3 comments · Fixed by #12536
Assignees
Labels
lang:less Issues affecting Less-specific syntax (not plain CSS) status:needs investigation Issues that need additional investigation, e.g. to understand whether the reported behavior is a bug type:bug Issues identifying ugly output, or a defect in the program

Comments

@lg-kialo
Copy link

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.

@fisker fisker added type:bug Issues identifying ugly output, or a defect in the program area:standalone Issues with Prettier's Standalone build (meant to be used in the browser) status:needs investigation Issues that need additional investigation, e.g. to understand whether the reported behavior is a bug lang:less Issues affecting Less-specific syntax (not plain CSS) and removed area:standalone Issues with Prettier's Standalone build (meant to be used in the browser) labels Mar 22, 2022
@viceice
Copy link

viceice commented Mar 22, 2022

Same on scss

// C:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\TEMPLATE\GLOBAL\XML\CMDUI.XML
$icons: (
  // Ribbon.Calendar.Calendar.Scope.DayGroup: Image16by16Top="-73" Image16by16Left="-253"
  cal-day-group:
    (
      left: 253,
      top: 73,
    ),
  // Ribbon.Calendar.Calendar.Scope.WeekGroup: Image16by16Top="-169" Image16by16Left="-1"
  cal-week-group:
    (
      left: 1,
      top: 169,
    )
);

Playground

@jimblue
Copy link

jimblue commented Mar 25, 2022

I was using Prettier v2.5.1 and it was working well.
Now since v2.6.0 I've got the same probleme describe here.

@fisker fisker self-assigned this Mar 25, 2022
@kai-dorschner-twinsity
Copy link

kai-dorschner-twinsity commented Mar 28, 2022

I'm here for the same error message in scss

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 30, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lang:less Issues affecting Less-specific syntax (not plain CSS) status:needs investigation Issues that need additional investigation, e.g. to understand whether the reported behavior is a bug type:bug Issues identifying ugly output, or a defect in the program
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants