Skip to content

Commit f31ef48

Browse files
committed
ref(nextjs): Update webpack-plugin and change how cli binary is detected (#4988)
Switch to using eval to workaround `@vercel/nft` detecting the binary itself as the hard dependency.
1 parent 0fc29b0 commit f31ef48

File tree

4 files changed

+19
-12
lines changed

4 files changed

+19
-12
lines changed

packages/gatsby/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"dependencies": {
2323
"@sentry/react": "7.0.0-alpha.1",
2424
"@sentry/tracing": "7.0.0-alpha.1",
25-
"@sentry/webpack-plugin": "1.18.8"
25+
"@sentry/webpack-plugin": "1.18.9"
2626
},
2727
"peerDependencies": {
2828
"gatsby": "^2.0.0 || ^3.0.0 || ^4.0.0",

packages/nextjs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"@sentry/react": "7.0.0-alpha.1",
2525
"@sentry/tracing": "7.0.0-alpha.1",
2626
"@sentry/utils": "7.0.0-alpha.1",
27-
"@sentry/webpack-plugin": "1.18.8",
27+
"@sentry/webpack-plugin": "1.18.9",
2828
"tslib": "^1.9.3"
2929
},
3030
"devDependencies": {

packages/nextjs/src/config/webpack.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,12 @@ export function getWebpackPluginOptions(
325325
return { ...defaultPluginOptions, ...userPluginOptions };
326326
}
327327

328+
/**
329+
* NOTE: `eval` usage is a workaround for @vercel/nft detecting the binary itself as the hard dependency
330+
* and effectively always including it in the bundle, which is not what we want.
331+
* ref: https://github.com/getsentry/sentry-javascript/issues/3865
332+
* ref: https://github.com/vercel/nft/issues/203
333+
*/
328334
function ensureCLIBinaryExists(): boolean {
329-
return fs.existsSync(path.join(require.resolve('@sentry/cli'), '../../sentry-cli'));
335+
return eval("fs.existsSync(path.join(require.resolve('@sentry/cli'), '../../sentry-cli'))");
330336
}

yarn.lock

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4237,24 +4237,25 @@
42374237
semver "7.3.2"
42384238
semver-intersect "1.4.0"
42394239

4240-
"@sentry/cli@^1.73.0":
4241-
version "1.73.0"
4242-
resolved "https://registry.yarnpkg.com/@sentry/cli/-/cli-1.73.0.tgz#0d0bce913e0060ae192741c6693c57e50078c886"
4243-
integrity sha512-n4YINqmoncGUkLEpd4WuW+oD+aoUyQPhRbSBSYkbCFxPPmopn1VExCB2Vvzwj7vjXYRRGkix6keBMS0LLs3A3Q==
4240+
"@sentry/cli@^1.74.4":
4241+
version "1.74.4"
4242+
resolved "https://registry.yarnpkg.com/@sentry/cli/-/cli-1.74.4.tgz#7df82f68045a155e1885bfcbb5d303e5259eb18e"
4243+
integrity sha512-BMfzYiedbModsNBJlKeBOLVYUtwSi99LJ8gxxE4Bp5N8hyjNIN0WVrozAVZ27mqzAuy6151Za3dpmOLO86YlGw==
42444244
dependencies:
42454245
https-proxy-agent "^5.0.0"
42464246
mkdirp "^0.5.5"
42474247
node-fetch "^2.6.7"
42484248
npmlog "^4.1.2"
42494249
progress "^2.0.3"
42504250
proxy-from-env "^1.1.0"
4251+
which "^2.0.2"
42514252

4252-
"@sentry/[email protected].8":
4253-
version "1.18.8"
4254-
resolved "https://registry.yarnpkg.com/@sentry/webpack-plugin/-/webpack-plugin-1.18.8.tgz#247a73a0aa9e28099a736bbe89ca0d35cbac7636"
4255-
integrity sha512-PtKr0NL62b5L3kPFGjwSNbIUwwcW5E5G6bQxAYZGpkgL1MFPnS4ND0SAsySuX0byQJRFFium5A19LpzyvQZSlQ==
4253+
"@sentry/[email protected].9":
4254+
version "1.18.9"
4255+
resolved "https://registry.yarnpkg.com/@sentry/webpack-plugin/-/webpack-plugin-1.18.9.tgz#acb48c0f96fdb9e73f1e1db374ea31ded6d883a8"
4256+
integrity sha512-+TrenJrgFM0QTOwBnw0ZXWMvc0PiOebp6GN5EbGEx3JPCQqXOfXFzCaEjBtASKRgcNCL7zGly41S25YR6Hm+jw==
42564257
dependencies:
4257-
"@sentry/cli" "^1.73.0"
4258+
"@sentry/cli" "^1.74.4"
42584259

42594260
"@simple-dom/interface@^1.4.0":
42604261
version "1.4.0"

0 commit comments

Comments
 (0)