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
@fisker this is because we use dirent.parentPath which doesn't exist in Node 16.x.
if we want to keep 16.x support (we should since its presumably a breaking change to drop it), we will need @fabiospampinato to emit the full path in tiny-readdir's onDirents.
a dirent has name and, in newer Node, parentPath. the name is the basename, the parentPath is path to the parent directory.
the solution is for tiny-readdir to emit the path of the directory it is reading, so we can join(dir, name). that is the equivalent of what works in newer node via parentPath.
here's the readdir PR: fabiospampinato/tiny-readdir#5
i also have the prettier-cli branch ready once that gets released.
Activity
43081j commentedon Nov 6, 2026
@fisker this is because we use
dirent.parentPathwhich doesn't exist in Node 16.x.if we want to keep 16.x support (we should since its presumably a breaking change to drop it), we will need @fabiospampinato to emit the full path in tiny-readdir's
onDirents.i can open a PR there
fisker commentedon Nov 6, 2026
If that's the case, we can fix ig in bundle step to use
dirent.parentPath ?? dirent.path. I'll have a test when I back to laptop.43081j commentedon Nov 6, 2026
no we can't.
a dirent has
nameand, in newer Node,parentPath. thenameis the basename, theparentPathis path to the parent directory.the solution is for tiny-readdir to emit the path of the directory it is reading, so we can
join(dir, name). that is the equivalent of what works in newer node via parentPath.here's the readdir PR: fabiospampinato/tiny-readdir#5
i also have the prettier-cli branch ready once that gets released.
fisker commentedon Nov 6, 2026
I don't understand,
parentPathis equivalent of the oldDirent#path, it should work.https://nodejs.org/api/deprecations.html#dep0178-direntpath
43081j commentedon Nov 6, 2026
i suppose the docs are misleading.
16.x doesn't have
pathorparentPath.the solution is tiny-readdir passing the root path to us
fisker commentedon Nov 8, 2026
You are right, thank you!