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

Cannot require() ES Module /media/hdd/local/project/php/l11-sim/node_modules/prettier/standalone.mjs in a cycle. (from /media/hdd/local/project/php/l11-sim/node_modules/@prettier/plugin-php/standalone.js) #2418

Open
utqinadhif opened this issue Feb 17, 2025 · 6 comments

Comments

@utqinadhif
Copy link

whats wrong?

@fisker

This comment has been minimized.

@fisker
Copy link
Member

fisker commented Feb 17, 2025

Ah, sorry. I thought this is the Prettier core repo, anyway I'll take a look. Would you mind take a look what version of Prettier are you using? Since it's possible caused by a recent change in Prettier core prettier/prettier#16958, released in v3.5

Maybe also related nodejs/node#52145

@utqinadhif
Copy link
Author

@fisker ah sorry, i use prettier 3.5.1. whats wrong?

@fisker
Copy link
Member

fisker commented Feb 17, 2025

I'll take a look.

@utqinadhif
Copy link
Author

error occurs when i install prettier using plugin @shufo/prettier-plugin-blade

@fisker
Copy link
Member

fisker commented Feb 17, 2025

@utqinadhif What version of Node.js are you using?

I tried this script,

const prettier  = require('prettier/standalone')
const prettierPluginPhp = require('@prettier/plugin-php/standalone')

;(async () => {
  const x = await prettier.format('<?php $a= 1', {
    parser:'php',
    plugins: [prettierPluginPhp]
  })
  console.log(x)
})();

it successfuly prints <?php $a = 1;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants