diff --git a/src/dom_components/model/Component.ts b/src/dom_components/model/Component.ts index 859a71000..9f77a5fe3 100644 --- a/src/dom_components/model/Component.ts +++ b/src/dom_components/model/Component.ts @@ -675,8 +675,14 @@ export default class Component extends StyleableModel { addId = !!sm?.get(id, sm.Selector.TYPE_ID); } - // Symbols should always have an id - if (this.__getSymbol() || this.__getSymbols()) { + if ( + // Symbols should always have an id + this.__getSymbol() || + this.__getSymbols() || + // Components with script should always have an id + this.get('script-export') || + this.get('script') + ) { addId = true; }