diff --git a/src/Ember/Server/index.ts b/src/Ember/Server/index.ts index f1321f5..c0109d6 100644 --- a/src/Ember/Server/index.ts +++ b/src/Ember/Server/index.ts @@ -122,7 +122,12 @@ export class EmberServer extends EventEmitter { const data = berEncode([el], RootType.Elements) let elPath = el.path if (el.contents.type !== ElementType.Node && !('targets' in update || 'sources' in update)) { - elPath = elPath.slice(0, -2) // remove the last element number + const lastDotIndex = elPath.lastIndexOf('.') + if (lastDotIndex > -1) { + elPath = elPath.slice(0, lastDotIndex) + } else { + elPath = '' + } } for (const [path, clients] of Object.entries(this._subscriptions)) {