Commit cb0cbdf 1 parent 65458d6 commit cb0cbdf Copy full SHA for cb0cbdf
File tree 1 file changed +10
-2
lines changed
1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -3,13 +3,21 @@ import type { Span } from 'next/dist/telemetry/trace/trace'
3
3
// Starting with v11.1.1, a trace is required.
4
4
// 'next/dist/telemetry/trace/trace' only exists since v10.0.9
5
5
// and our peerDeps support back to v8 so try-catch this import
6
+ // Starting from 12.0 trace is now located in 'next/dist/trace/trace'
6
7
export async function getRunWebpackSpan ( ) : Promise < { runWebpackSpan ?: Span } > {
7
8
let trace : ( name : string ) => Span
8
9
9
10
try {
10
- trace = await import ( 'next/dist/telemetry/trace/trace' ) . then ( ( m ) => m . trace )
11
+ try {
12
+ trace = await import ( 'next/dist/telemetry/trace/trace' ) . then ( ( m ) => m . trace )
11
13
12
- return { runWebpackSpan : trace ( 'cypress' ) }
14
+ return { runWebpackSpan : trace ( 'cypress' ) }
15
+ } catch ( _ ) {
16
+ // @ts -ignore
17
+ trace = await import ( 'next/dist/trace/trace' ) . then ( ( m ) => m . trace )
18
+
19
+ return { runWebpackSpan : trace ( 'cypress' ) }
20
+ }
13
21
} catch ( _ ) {
14
22
return { }
15
23
}
You can’t perform that action at this time.
0 commit comments