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
@sentry/utils fails to postinstall using latest yarn (v4.0.2) and pnpm (v8.14.1) #10150
➜ mq-forge git:(main) ✗ cat /private/var/folders/79/w6yvk6jd3vvgtmx_1pg7fq3h0000gn/T/xfs-1d7e729a/build.log
# This file contains the result of Yarn building a package (@forge/cli@npm:7.0.0::__archiveUrl=https%3A%2F%2Fpackages.atlassian.com%2Fapi%2Fnpm%2Fnpm-remote%2F%40forge%2Fcli%2F-%2Fcli-7.0.0.tgz)
# Script name: postinstall
/Users/dsorin/.yarn/berry/cache/@sentry-utils-npm-7.93.0-82a918ee1f-10c0.zip/node_modules/@sentry/utils/cjs/path.js:61
const truncated = filename.length > 1024 ? `<truncated>${filename.slice(-1024)}` : filename;
^
TypeError: Cannot read properties of undefined (reading 'length')
at splitPath (/Users/dsorin/.yarn/berry/cache/@sentry-utils-npm-7.93.0-82a918ee1f-10c0.zip/node_modules/@sentry/utils/cjs/path.js:61:30)
at Object.dirname (/Users/dsorin/.yarn/berry/cache/@sentry-utils-npm-7.93.0-82a918ee1f-10c0.zip/node_modules/@sentry/utils/cjs/path.js:187:18)
at Object.createGetModuleFromFilename (/Users/dsorin/.yarn/berry/cache/@sentry-node-npm-7.93.0-4cfe51eb73-10c0.zip/node_modules/@sentry/node/cjs/module.js:15:20)
at Object.<anonymous> (/Users/dsorin/.yarn/berry/cache/@sentry-node-npm-7.93.0-4cfe51eb73-10c0.zip/node_modules/@sentry/node/cjs/sdk.js:230:87)
at Module._compile (node:internal/modules/cjs/loader:1376:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1435:10)
at require$$0.Module._extensions..js (/Users/dsorin/atlassian/merge-queue-forge/.pnp.cjs:18625:33)
at Module.load (node:internal/modules/cjs/loader:1207:32)
at Module._load (node:internal/modules/cjs/loader:1023:12)
at require$$0.Module._load (/Users/dsorin/atlassian/merge-queue-forge/.pnp.cjs:18473:31)
Node.js v20.10.0
Activity
lforst commentedon Jan 11, 2024
Hi, can you please share concrete reproduction steps? Thanks!
AbhiPrasad commentedon Jan 11, 2024
cc @timfish - anything strike out to you here?
timfish commentedon Jan 11, 2024
No idea why this is happening in a postinstall script...
But it's clearly because we're calling
dirname(process.argv[1])andprocess.argv[1]is somehow undefined.fix(node): Guard against `process.argv[1]` being undefined (#10155)