File tree Expand file tree Collapse file tree 3 files changed +7
-14
lines changed Expand file tree Collapse file tree 3 files changed +7
-14
lines changed Original file line number Diff line number Diff line change @@ -2104,7 +2104,9 @@ class Component {
2104
2104
}
2105
2105
}
2106
2106
catch ( error ) {
2107
- console . error ( 'There was a problem with the component HTML returned:' ) ;
2107
+ console . error ( `There was a problem with the '${ this . name } ' component HTML returned:` , {
2108
+ id : this . id
2109
+ } ) ;
2108
2110
throw error ;
2109
2111
}
2110
2112
this . externalMutationTracker . handlePendingChanges ( ) ;
Original file line number Diff line number Diff line change @@ -363,8 +363,9 @@ export default class Component {
363
363
throw new Error ( 'A live component template must contain a single root controller element.' ) ;
364
364
}
365
365
} catch ( error ) {
366
- console . error ( 'There was a problem with the component HTML returned:' ) ;
367
-
366
+ console . error ( `There was a problem with the '${ this . name } ' component HTML returned:` , {
367
+ id : this . id
368
+ } ) ;
368
369
throw error ;
369
370
}
370
371
Original file line number Diff line number Diff line change @@ -238,18 +238,8 @@ export function htmlToElement(html: string): HTMLElement {
238
238
template . innerHTML = html ;
239
239
240
240
if ( template . content . childElementCount > 1 ) {
241
- let identifier = '' ;
242
- const firstChild = template . content . firstElementChild ;
243
- if ( firstChild instanceof HTMLElement ) {
244
- identifier = ' Id: ' + firstChild . id ;
245
-
246
- if ( firstChild . dataset . liveNameValue ) {
247
- identifier += ' Component: ' + firstChild . dataset . liveNameValue ;
248
- }
249
- }
250
-
251
241
throw new Error (
252
- `Component${ identifier } HTML contains ${ template . content . childElementCount } elements, but only 1 root element is allowed.`
242
+ `Component HTML contains ${ template . content . childElementCount } elements, but only 1 root element is allowed.`
253
243
) ;
254
244
}
255
245
You can’t perform that action at this time.
0 commit comments