File tree Expand file tree Collapse file tree 1 file changed +14
-7
lines changed
packages/adapter-node/src Expand file tree Collapse file tree 1 file changed +14
-7
lines changed Original file line number Diff line number Diff line change @@ -6,12 +6,19 @@ const dirname = new URL('.', import.meta.url).pathname;
6
6
const instrumentFile = join ( dirname , 'server' , 'instrument.server.js' ) ;
7
7
8
8
if ( existsSync ( instrumentFile ) ) {
9
- import ( instrumentFile ) . then ( ( hooks ) => {
10
- if ( hooks ?. instrument && typeof hooks . instrument === 'function' ) {
11
- hooks . instrument ( ) ;
12
- }
13
- import ( './start.js' ) ;
14
- } ) ;
9
+ import ( instrumentFile )
10
+ . catch ( ( err ) => {
11
+ console . error ( 'Failed to import instrument.server.js' , err ) ;
12
+ } )
13
+ . finally ( ( ) => {
14
+ tryImportStart ( ) ;
15
+ } ) ;
15
16
} else {
16
- import ( 'c' ) ;
17
+ tryImportStart ( ) ;
18
+ }
19
+
20
+ function tryImportStart ( ) {
21
+ import ( './start.js' ) . catch ( ( err ) => {
22
+ console . error ( 'Failed to import server (start.js)' , err ) ;
23
+ } ) ;
17
24
}
You can’t perform that action at this time.
0 commit comments