You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: Cannot require() ES Module ~ standalone.mjs in a cycle when Node >=v22.12.0 with Prettier >= 3.5.0 #311
after update from 1.15.2 to 1.15.3, prettier not working with caption 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)
changed the title [-][Bug]: 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)[/-][+][Bug]: `Cannot require() ES Module ~ standalone.mjs in a cycle` with Node v23 on latest version[/+]on Feb 18, 2025
./node_modules/.bin/prettier /media/hdd/local/project/php/l11-sim/resources/views/pdf/display/apm/print/sep.blade.php ─╯
[error] 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)
Uh I understand, it occurs when combination of node >=v23 with prettier-plugin-blade latest version.
$ node -v
v23.6.1
$ ./node_modules/.bin/prettier test.blade.php
[error] Cannot require() ES Module /home/shuhei/develop/prettier-plugin-blade-test6/node_modules/prettier/standalone.mjs in a cycle. (from /home/shuhei/develop/prettier-plugin-blade-test6/node_modules/@prettier/plugin-php/standalone.js)
Node v22 with latest version was ok.
i just tried it with node 22 (& plugin 1.15.3), its not working. i'm on v23 for quite some time (its highly unlikely the cause). faced issues recently (went from 1.13.4 to 1.15.3).
Got it working by downgrading to 1.13.4 with node 23
changed the title [-][Bug]: `Cannot require() ES Module ~ standalone.mjs in a cycle` with Node v23 on latest version[/-][+][Bug]: `Cannot require() ES Module ~ standalone.mjs in a cycle` when Node >=v22.12.0 with latest version[/+]on Feb 18, 2025
note: if you are using brew, i was not able to install a specific version. instead it kept installing the latest patch (v22.13.1). hence had to install 22.11 via nvm
Activity
rishabkapadia commentedon Feb 17, 2025
currently downgraded to get going:
"@shufo/prettier-plugin-blade": "=1.14.1",npm update @shufo/prettier-plugin-bladeshufo commentedon Feb 18, 2025
Sorry I could not reproduce the error with latest version with prettier 3.5.1
@utqinadhif @rishabkapadia
Can you give how to reproduce the error?
rishabkapadia commentedon Feb 18, 2025
macOS 14.7.2
PHP 8.3.14
also tried:
nadhifbeo commentedon Feb 18, 2025
Thanks
shufo commentedon Feb 18, 2025
Uh I understand, it occurs when combination of node >=v23 with prettier-plugin-blade latest version.
Node v22 with latest version was ok.
[-][Bug]: 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)[/-][+][Bug]: `Cannot require() ES Module ~ standalone.mjs in a cycle` with Node v23 on latest version[/+]nadhifbeo commentedon Feb 18, 2025
node -v ─╯
v22.14.0
./node_modules/.bin/prettier /media/hdd/local/project/php/l11-sim/resources/views/pdf/display/apm/print/sep.blade.php ─╯
[error] 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)
In my case, i use v22.14.0 but error,
nadhifbeo commentedon Feb 18, 2025
Oh i know, before today, before i update my node, the prettier work well, may be error occurs on >=22.14.0
rishabkapadia commentedon Feb 18, 2025
i just tried it with node 22 (& plugin 1.15.3), its not working. i'm on v23 for quite some time (its highly unlikely the cause). faced issues recently (went from 1.13.4 to 1.15.3).
Got it working by downgrading to 1.13.4 with node 23
shufo commentedon Feb 18, 2025
@utqinadhif @rishabkapadia Thanks.
#311 (comment) was not corret.
It seems above node >=v22.12.0 got error.
v22.11.0 is ok
[-][Bug]: `Cannot require() ES Module ~ standalone.mjs in a cycle` with Node v23 on latest version[/-][+][Bug]: `Cannot require() ES Module ~ standalone.mjs in a cycle` when Node >=v22.12.0 with latest version[/+]rishabkapadia commentedon Feb 18, 2025
that worked. thank you.
note: if you are using brew, i was not able to install a specific version. instead it kept installing the latest patch (v22.13.1). hence had to install 22.11 via nvm
25 remaining items
module: handle cached linked async jobs in require(esm)
module: handle cached linked async jobs in require(esm)
module: handle cached linked async jobs in require(esm)
module: handle cached linked async jobs in require(esm)
module: handle cached linked async jobs in require(esm)
module: handle cached linked async jobs in require(esm)
module: handle cached linked async jobs in require(esm)
module: handle cached linked async jobs in require(esm)