File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
packages/nextjs/src/client Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -113,7 +113,17 @@ function addClientIntegrations(options: BrowserOptions): void {
113113 if ( hasTracingEnabled ( options ) ) {
114114 const defaultBrowserTracingIntegration = new BrowserTracing ( {
115115 // eslint-disable-next-line deprecation/deprecation
116- tracingOrigins : [ ...defaultRequestInstrumentationOptions . tracingOrigins , / ^ ( a p i \/ ) / ] ,
116+ tracingOrigins :
117+ process . env . NODE_ENV === 'development'
118+ ? [
119+ // Will match any URL that contains "localhost" but not "webpack.hot-update.json" - The webpack dev-server
120+ // has cors and it doesn't like extra headers when it's accessed from a different URL.
121+ // TODO(v8): Ideally we rework our tracePropagationTargets logic so this hack won't be necessary anymore (see issue #9764)
122+ / ^ (? = .* l o c a l h o s t ) (? ! .* w e b p a c k \. h o t - u p d a t e \. j s o n ) .* / ,
123+ / ^ \/ (? ! \/ ) / ,
124+ ]
125+ : // eslint-disable-next-line deprecation/deprecation
126+ [ ...defaultRequestInstrumentationOptions . tracingOrigins , / ^ ( a p i \/ ) / ] ,
117127 routingInstrumentation : nextRouterInstrumentation ,
118128 } ) ;
119129
You can’t perform that action at this time.
0 commit comments