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

Error: "highest level" was not printed #15073

Closed
sheldonmaschmeyer opened this issue Jul 10, 2023 · 7 comments
Closed

Error: "highest level" was not printed #15073

sheldonmaschmeyer opened this issue Jul 10, 2023 · 7 comments
Labels
locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting. status:awaiting response Issues that require answers to questions from maintainers before action can be taken

Comments

@sheldonmaschmeyer
Copy link

sheldonmaschmeyer commented Jul 10, 2023

"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"

@JounQin
Copy link
Member

JounQin commented Jul 11, 2023

You need provide more details.

@fisker fisker added the status:awaiting response Issues that require answers to questions from maintainers before action can be taken label Jul 11, 2023
@Eejit43
Copy link

Eejit43 commented Jul 12, 2023

This is likely a duplicate of #15007.

@github-actions
Copy link

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.

@SheldonWBM
Copy link

SheldonWBM commented Jul 28, 2023

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;
};

@SheldonWBM
Copy link

SheldonWBM commented Jul 28, 2023

This is likely a duplicate of #15007.

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

@SheldonWBM
Copy link

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.

@fisker
Copy link
Member

fisker commented Jul 29, 2023

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

We'll release it soon.

@github-actions github-actions bot added the locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting. label Oct 28, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 28, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting. status:awaiting response Issues that require answers to questions from maintainers before action can be taken
Projects
None yet
Development

No branches or pull requests

5 participants