@@ -6,13 +6,14 @@ import { Uri } from 'vscode';
6
6
import { disposeAllDisposables } from '../../platform/common/helpers' ;
7
7
import { getDisplayPath } from '../../platform/common/platform/fs-paths' ;
8
8
import { IDisposable } from '../../platform/common/types' ;
9
- import { traceWarning } from '../../platform/logging' ;
9
+ import { traceInfoIfCI , traceWarning } from '../../platform/logging' ;
10
10
import { sendTelemetryEvent , Telemetry } from '../../telemetry' ;
11
11
import { IKernel , isLocalConnection } from '../types' ;
12
12
import { getTelemetrySafeHashedString } from '../../platform/telemetry/helpers' ;
13
13
import * as stripComments from 'strip-comments' ;
14
14
import { IIPyWidgetScriptManager } from './types' ;
15
15
import { StopWatch } from '../../platform/common/utils/stopWatch' ;
16
+ import { isCI } from '../../platform/common/constants' ;
16
17
17
18
export function extractRequireConfigFromWidgetEntry ( baseUrl : Uri , widgetFolderName : string , contents : string ) {
18
19
// Look for `require.config(` or `window["require"].config` or `window['requirejs'].config`
@@ -148,9 +149,21 @@ export abstract class BaseIPyWidgetScriptManager implements IIPyWidgetScriptMana
148
149
149
150
try {
150
151
const config = await extractRequireConfigFromWidgetEntry ( baseUrl , widgetFolderName , contents ) ;
152
+ if ( ! config ) {
153
+ let message = `Failed to extract require.config from widget for ${ widgetFolderName } from ${ getDisplayPath (
154
+ script
155
+ ) } `;
156
+ if ( isCI ) {
157
+ message += `with contents ${ contents } ` ;
158
+ }
159
+ traceWarning ( message ) ;
160
+ }
151
161
return config ;
152
162
} catch ( ex ) {
153
- traceWarning ( `Failed to extract require.config entry from ${ getDisplayPath ( script ) } ` , ex ) ;
163
+ traceWarning (
164
+ `Failed to extract require.config entry for ${ widgetFolderName } from ${ getDisplayPath ( script ) } ` ,
165
+ ex
166
+ ) ;
154
167
}
155
168
}
156
169
private async getWidgetModuleMappingsImpl ( ) : Promise < Record < string , Uri > | undefined > {
@@ -160,6 +173,7 @@ export abstract class BaseIPyWidgetScriptManager implements IIPyWidgetScriptMana
160
173
this . getNbExtensionsParentPath ( )
161
174
] ) ;
162
175
if ( ! baseUrl ) {
176
+ traceInfoIfCI ( 'No base Url to retrieve widget module mappings' ) ;
163
177
return ;
164
178
}
165
179
const widgetConfigs = await Promise . all (
@@ -173,6 +187,12 @@ export abstract class BaseIPyWidgetScriptManager implements IIPyWidgetScriptMana
173
187
delete config [ '@jupyter-widgets/base' ] ;
174
188
delete config [ '@jupyter-widgets/controls' ] ;
175
189
delete config [ '@jupyter-widgets/output' ] ;
190
+ } else {
191
+ traceInfoIfCI (
192
+ `No config, entryPoints = ${ JSON . stringify ( entryPoints ) } , widgetConfigs = ${ JSON . stringify (
193
+ widgetConfigs
194
+ ) } `
195
+ ) ;
176
196
}
177
197
sendTelemetryEvent ( Telemetry . DiscoverIPyWidgetNamesPerf , stopWatch . elapsedTime , {
178
198
type : isLocalConnection ( this . kernel . kernelConnectionMetadata ) ? 'local' : 'remote'
0 commit comments