File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
packages/nextjs/src/config/polyfills Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change 11// Polyfill for Node.js perf_hooks module in edge runtime
22// This mirrors the polyfill from packages/vercel-edge/rollup.npm.config.mjs
3+ const __sentry__timeOrigin = Date . now ( ) ;
34
45// Ensure performance global is available
56if ( typeof globalThis !== 'undefined' && globalThis . performance === undefined ) {
67 globalThis . performance = {
7- timeOrigin : 0 ,
8+ timeOrigin : __sentry__timeOrigin ,
89 now : function ( ) {
9- return Date . now ( ) ;
10+ return Date . now ( ) - __sentry__timeOrigin ;
1011 } ,
1112 } ;
1213}
1314
1415// Export the performance object for perf_hooks compatibility
1516export const performance = globalThis . performance || {
16- timeOrigin : 0 ,
17+ timeOrigin : __sentry__timeOrigin ,
1718 now : function ( ) {
18- return Date . now ( ) ;
19+ return Date . now ( ) - __sentry__timeOrigin ;
1920 } ,
2021} ;
2122
You can’t perform that action at this time.
0 commit comments