Skip to content

Commit cb8d440

Browse files
committed
ref(nextjs): Update webpack-plugin and change how cli binary is detected
1 parent c518955 commit cb8d440

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": "6.19.7",
2424
"@sentry/tracing": "6.19.7",
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": "6.19.7",
2525
"@sentry/tracing": "6.19.7",
2626
"@sentry/utils": "6.19.7",
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
@@ -3130,24 +3130,25 @@
31303130
estree-walker "^2.0.1"
31313131
picomatch "^2.2.2"
31323132

3133-
"@sentry/cli@^1.73.0":
3134-
version "1.73.0"
3135-
resolved "https://registry.yarnpkg.com/@sentry/cli/-/cli-1.73.0.tgz#0d0bce913e0060ae192741c6693c57e50078c886"
3136-
integrity sha512-n4YINqmoncGUkLEpd4WuW+oD+aoUyQPhRbSBSYkbCFxPPmopn1VExCB2Vvzwj7vjXYRRGkix6keBMS0LLs3A3Q==
3133+
"@sentry/cli@^1.74.4":
3134+
version "1.74.4"
3135+
resolved "https://registry.yarnpkg.com/@sentry/cli/-/cli-1.74.4.tgz#7df82f68045a155e1885bfcbb5d303e5259eb18e"
3136+
integrity sha512-BMfzYiedbModsNBJlKeBOLVYUtwSi99LJ8gxxE4Bp5N8hyjNIN0WVrozAVZ27mqzAuy6151Za3dpmOLO86YlGw==
31373137
dependencies:
31383138
https-proxy-agent "^5.0.0"
31393139
mkdirp "^0.5.5"
31403140
node-fetch "^2.6.7"
31413141
npmlog "^4.1.2"
31423142
progress "^2.0.3"
31433143
proxy-from-env "^1.1.0"
3144+
which "^2.0.2"
31443145

3145-
"@sentry/[email protected].8":
3146-
version "1.18.8"
3147-
resolved "https://registry.yarnpkg.com/@sentry/webpack-plugin/-/webpack-plugin-1.18.8.tgz#247a73a0aa9e28099a736bbe89ca0d35cbac7636"
3148-
integrity sha512-PtKr0NL62b5L3kPFGjwSNbIUwwcW5E5G6bQxAYZGpkgL1MFPnS4ND0SAsySuX0byQJRFFium5A19LpzyvQZSlQ==
3146+
"@sentry/[email protected].9":
3147+
version "1.18.9"
3148+
resolved "https://registry.yarnpkg.com/@sentry/webpack-plugin/-/webpack-plugin-1.18.9.tgz#acb48c0f96fdb9e73f1e1db374ea31ded6d883a8"
3149+
integrity sha512-+TrenJrgFM0QTOwBnw0ZXWMvc0PiOebp6GN5EbGEx3JPCQqXOfXFzCaEjBtASKRgcNCL7zGly41S25YR6Hm+jw==
31493150
dependencies:
3150-
"@sentry/cli" "^1.73.0"
3151+
"@sentry/cli" "^1.74.4"
31513152

31523153
"@simple-dom/interface@^1.4.0":
31533154
version "1.4.0"

0 commit comments

Comments
 (0)