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
node:internal/errors:465
ErrorCaptureStackTrace(err);
^
TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received type number (20)
at new NodeError (node:internal/errors:372:5)
at validateString (node:internal/validators:120:11)
at Object.isAbsolute (node:path:1157:5)
at VirtualFS.mapToBase (/Users/christian/dev/github/yarnpkg/berry/.pnp.cjs:48282:24)
at VirtualFS.truncatePromise (/Users/christian/dev/github/yarnpkg/berry/.pnp.cjs:48182:45)
at PosixFS.truncatePromise (/Users/christian/dev/github/yarnpkg/berry/.pnp.cjs:48182:24)
at URLFS.truncatePromise (/Users/christian/dev/github/yarnpkg/berry/.pnp.cjs:48182:24)
at FileHandle.truncate (/Users/christian/dev/github/yarnpkg/berry/.pnp.cjs:49331:27)
at file:///Users/christian/dev/github/yarnpkg/berry/bug.mjs:3:14 {
code: 'ERR_INVALID_ARG_TYPE'
}
To reproduce
const{ open }=require('fs/promises')awaitexpect(asyncfunction(){consthandle=awaitopen('test.txt','w')awaithandle.truncate(0)awaithandle.close()}()).resolves.toBeUndefined()
Error: expect(received).resolves.toBeUndefined()
Received promise rejected instead of resolved
Rejected to value: [TypeError: The "path" argument must be of type string. Received type number (54)]
at expect (/github/workspace/.yarn/cache/expect-npm-24.8.0-8c7640c562-44ff9ab1e7.zip/node_modules/expect/build/index.js:138:15)
at module.exports (evalmachine.<anonymous>:4:7)
at /github/workspace/.yarn/cache/@arcanis-sherlock-npm-2.0.3-558f52b79f-286d94b96d.zip/node_modules/@arcanis/sherlock/lib/executeRepro.js:57:19
at executeInTempDirectory (/github/workspace/.yarn/cache/@arcanis-sherlock-npm-2.0.3-558f52b79f-286d94b96d.zip/node_modules/@arcanis/sherlock/lib/executeRepro.js:18:22)
at executeRepro (/github/workspace/.yarn/cache/@arcanis-sherlock-npm-2.0.3-558f52b79f-286d94b96d.zip/node_modules/@arcanis/sherlock/lib/executeRepro.js:25:18)
at ExecCommand.execute (/github/workspace/.yarn/cache/@arcanis-sherlock-npm-2.0.3-558f52b79f-286d94b96d.zip/node_modules/@arcanis/sherlock/lib/commands/exec.js:26:76)
at async ExecCommand.validateAndExecute (/github/workspace/.yarn/cache/clipanion-npm-2.0.0-rc.16-b9444aaf89-4061026d74.zip/node_modules/clipanion/lib/advanced/Command.js:161:26)
at async Cli.run (/github/workspace/.yarn/cache/clipanion-npm-2.0.0-rc.16-b9444aaf89-4061026d74.zip/node_modules/clipanion/lib/advanced/Cli.js:74:24)
at async Cli.runExit (/github/workspace/.yarn/cache/clipanion-npm-2.0.0-rc.16-b9444aaf89-4061026d74.zip/node_modules/clipanion/lib/advanced/Cli.js:83:28)
Self-service
Describe the bug
The following code works if it is run as
node bug.mjs
, but fails if it is run asyarn node bug.mjs
Here is the output when running with
yarn node
:To reproduce
Environment
Additional context
No response
The text was updated successfully, but these errors were encountered: