Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"@sentry/node": "latest || *"
},
"devDependencies": {
"rollup": "^4.24.2",
"rollup": "^4.35.0",
"vitest": "^0.34.6",
"@sentry/rollup-plugin": "2.22.6"
},
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@
"npm-run-all2": "^6.2.0",
"prettier": "^3.1.1",
"rimraf": "^5.0.10",
"rollup": "^4.24.2",
"rollup": "^4.35.0",
"rollup-plugin-cleanup": "^3.2.1",
"rollup-plugin-license": "^3.3.1",
"size-limit": "~11.1.6",
Expand Down
2 changes: 1 addition & 1 deletion packages/nextjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
"@sentry/webpack-plugin": "3.2.2",
"chalk": "3.0.0",
"resolve": "1.22.8",
"rollup": "4.34.9",
"rollup": "4.35.0",
"stacktrace-parser": "^0.1.10"
},
"devDependencies": {
Expand Down
9 changes: 7 additions & 2 deletions packages/nextjs/src/config/templates/pageWrapperTemplate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,17 @@ const origGetInitialProps = pageComponent ? pageComponent.getInitialProps : unde
const origGetStaticProps = userPageModule ? userPageModule.getStaticProps : undefined;
const origGetServerSideProps = userPageModule ? userPageModule.getServerSideProps : undefined;

// Rollup will aggressively tree-shake what it perceives to be unused properties
// on objects. Because the key that's used to index into this object (__ROUTE__)
// is replaced during bundling, Rollup can't see that these properties are in fact
// used. Using `Object.freeze` signals to Rollup that it should not tree-shake
// this object.
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const getInitialPropsWrappers: Record<string, any> = {
const getInitialPropsWrappers: Record<string, any> = Object.freeze({
'/_app': Sentry.wrapAppGetInitialPropsWithSentry,
'/_document': Sentry.wrapDocumentGetInitialPropsWithSentry,
'/_error': Sentry.wrapErrorGetInitialPropsWithSentry,
};
});

const getInitialPropsWrapper = getInitialPropsWrappers['__ROUTE__'] || Sentry.wrapGetInitialPropsWithSentry;

Expand Down
Loading
Loading