Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion packages/lexical/src/LexicalUpdates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -880,7 +880,8 @@ function $triggerEnqueuedUpdates(editor: LexicalEditor): void {
try {
invariant(
false,
'One or more update listeners are endlessly enqueueing more updates. May have encountered infinite recursion caused by update listeners that trigger additional updates without a stop condition.',
'One or more update listeners are endlessly enqueueing more updates. May have encountered infinite recursion caused by update listeners that trigger additional updates without a stop condition. Editor namespace: %s',
editor._config.namespace,
);
} catch (error) {
if (error instanceof Error) {
Expand Down
6 changes: 6 additions & 0 deletions packages/lexical/src/__tests__/unit/LexicalEditor.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1216,6 +1216,12 @@ describe('LexicalEditor tests', () => {
expect(errorListener.mock.calls[0][0].message).toMatch(
/endlessly enqueueing/,
);
// The error message should include the editor's namespace so the loop can
// be attributed to a specific product/editor in error aggregation, even
// when the production stack is minified to core frames.
expect(errorListener.mock.calls[0][0].message).toContain(
`Editor namespace: ${editor._config.namespace}`,
);

unregisterListener();

Expand Down