Visitar URL original
Error: "highest level" was not printed · Issue #15073 · prettier/prettier · GitHub
Skip to content

Error: "highest level" was not printed #15073

Closed

Description

@sheldonmaschmeyer

"prettier": "^3.0.0",
"eslint-plugin-prettier": "^5.0.0-alpha.2",
node --version
v18.16.0

Oops! Something went wrong! :(

ESLint: 8.44.0

Error: Comment "highest level" was not printed. Please report this error!
    at ensureAllCommentsPrinted (file:///home/app/.yarn/cache/prettier-npm-3.0.0-7ffbcce680-6a832876a1.zip/node_modules/prettier/index.mjs:17941:13)
    at printAstToDoc (file:///home/app/.yarn/cache/prettier-npm-3.0.0-7ffbcce680-6a832876a1.zip/node_modules/prettier/index.mjs:18102:3)
    at async coreFormat (file:///home/app/.yarn/cache/prettier-npm-3.0.0-7ffbcce680-6a832876a1.zip/node_modules/prettier/index.mjs:18405:14)
    at async formatWithCursor (file:///home/app/.yarn/cache/prettier-npm-3.0.0-7ffbcce680-6a832876a1.zip/node_modules/prettier/index.mjs:18603:14)
    at async Module.format2 (file:///home/app/.yarn/cache/prettier-npm-3.0.0-7ffbcce680-6a832876a1.zip/node_modules/prettier/index.mjs:21789:25)

Does not occur with "prettier": "^2.8.8" and "eslint-plugin-prettier": "^4.2.1"

Activity

  1. JounQin commented on Jul 11, 2023

    @JounQin
    Member

    You need provide more details.

  2. added
    status:awaiting responseIssues that require answers to questions from maintainers before action can be taken
    on Jul 11, 2023
  3. Eejit43 commented on Jul 12, 2023

    @Eejit43

    This is likely a duplicate of #15007.

  4. github-actions commented on Jul 26, 2023

    @github-actions
    Contributor

    This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have enough information to take action. Please reach out if you have or find the answers we need so that we can investigate further.

  5. SheldonWBM commented on Jul 28, 2023

    @SheldonWBM

    Determined where the error occurred. Deleting the comment "highest level" fixes it, but not why it occurred.
    Prettier should not crash on the comment.

    const something = (myNum: number): number => {
      if (myNum <= 11) return 0.0625;
      else if (myNum === 12) return 0.125;
      else if (myNum === 13) return 0.25;
      else if (myNum === 14) return 0.5;
      else if (myNum === 15) return 1.0;
      else if (myNum === 16) return 2.0;
      else if (myNum === 17) return 4.0;
      else if (myNum === 18) return 8.0; // highest level
      else return 10.0;
    };
    
  6. SheldonWBM commented on Jul 28, 2023

    @SheldonWBM

    This is likely a duplicate of #15007.

    It is unlikely related to the above issue but it is potentially related to this issue: #10592

  7. SheldonWBM commented on Jul 28, 2023

    @SheldonWBM

    This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have enough information to take action. Please reach out if you have or find the answers we need so that we can investigate further.

    Auto-close PRs within a month? This error is low on my priority list. Good to address on a Friday evening. Now using version 3 but, concerned that a simple comment can crash it.

  8. fisker commented on Jul 29, 2023

    @fisker
    Member

    @SheldonWBM Your case is duplicated of #15007, and #15076 fixed it. Playground

    We'll release it soon.

  9. locked as resolved and limited conversation to collaborators on Oct 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    locked-due-to-inactivityPlease open a new issue and fill out the template instead of commenting.status:awaiting responseIssues that require answers to questions from maintainers before action can be taken

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions