Circular reference error occurs when copying a formula and pasting using keyboard selection in Syncfusion Spreadsheet

We encountered an unexpected circular reference error in Syncfusion Spreadsheet when copying a cell containing a formula and pasting it across multiple cells using keyboard shortcuts.

This issue occurs even though the formula logic itself does not create any circular reference.


Steps to Reproduce

  1. Open a Syncfusion Spreadsheet.

  2. Set the following values:

    • Cell A1: 10

    • Cell B1: =A1 + 10

  3. Select cell B1.

  4. Press Ctrl + C to copy.

  5. Press Ctrl + Shift + Right Arrow to select all cells to the right of B1.

  6. Press Ctrl + V to paste.




Attachment: Screencast_from_20251222_160716_d8e9888a.zip

6 Replies 1 reply marked as answer

DR Deira Raj Rajkumar Syncfusion Team December 24, 2025 06:55 AM UTC

Hi Ngoc Hoang,


We validated your reported query based on the shared details and video reference.  We tried to replicate the issue at our end by following your shared steps in our latest version of Spreadsheet.  But we weren’t able to replicate the issue at our end.


Furthermore, we tried the same in the sample with the older versions (29.1.39) and we were able to recreate the issue. We would like to let you know that we have already identified this as an issue in our end during internal testing and have fixed this issue. Therefore, we recommend upgrading to the latest stable version (32.1.19 or 32.1.20) of our component.


Additionally, while checking your video we found that you have used our preview sample in react getting started documentation.  During our investigation, we found that the latest changes have not yet been reflected in the UG section. However, we have taken note of this, and we will update the samples in our upcoming releases.


For your convenience, we have shared below the sample we have used at our end and a video demonstrating that the issue is not taking place at our end.


Output reference: kindly refer to the attachment.


Sample link: Hzy6kjbm (duplicated) - StackBlitz


Kindly check with the above details and please get back to us if you have any further questions or other concerns.


With regards,

Deira.


Attachment: formula_reference_75993ab1.gif

Marked as answer

NH Ngoc Hoang replied to Deira Raj Rajkumar January 8, 2026 03:12 PM UTC

Hi Deira Raj Rajkumar,

I have upgraded to version 32.1.19, and the Syncfusion Spreadsheet issue has been fixed.

However, with "@syncfusion/ej2-react-diagrams": "32.1.19", I am encountering a runtime error: ReferenceError: document is not defined.

If I downgrade the version to 28.2.3, the issue does not occur.

Environment:
"next": "^15.4.10" (Page Router)

Image_4454_1767885139038




MG Moulidharan Gopalakrishnan Syncfusion Team January 9, 2026 12:48 PM UTC

Hi,

Thanks for the update and great to hear the Spreadsheet issue is resolved in 32.1.19.

Regarding issue with Diagram package version. Could you please confirm that you are using React with Next.js (Page Router) and the following environment details: Next.js ^15.4.10 and @syncfusion/[email protected]? Also, to assist you better, kindly share a minimal Next.js sample that replicates the ReferenceError: document is not defined issue. This will help us analyze and provide an accurate solution.

 

Best regards,

Moulidharan



NH Ngoc Hoang replied to Moulidharan Gopalakrishnan January 10, 2026 02:26 AM UTC

Thank you for your response.
I tested with Next.js Page Router and encountered the error ReferenceError: document is not defined. The source code is provided below.

I would greatly appreciate your support. Thank you.



Attachment: ej2nextjsdiagram_a089b426.zip


MG Moulidharan Gopalakrishnan Syncfusion Team January 12, 2026 11:48 AM UTC

Hi,

Thank you for sharing the sample. Based on the provided example, the error you’re encountering suggests that server-side rendering (SSR) is attempting to execute code that references browser-specific objects such as document or window. In Next.js, any module that interacts with the DOM must be executed on the client side only.

This is a known issue, and we’re actively working on a fix. The resolution will be included in our upcoming weekly release, scheduled for January 20, 2026.

Regards,
Moulidharan






MG Moulidharan Gopalakrishnan Syncfusion Team January 20, 2026 05:49 PM UTC

Hi Ngoc Hoang,

 

Reported issue:  ReferenceError: document is not defined in Next JS.

We have fixed the reported issue and included it in our latest patch release which is rolled out successfully.

Please upgrade to the latest version (v32.1.24) packages of the diagram to resolve this issue.      

https://www.npmjs.com/package/@syncfusion/ej2-diagrams 

 

Root cause: Due to the usage of document.createElement outside the function, exception occurs in environments like Next JS SSR and angular on Module validation.


Regards,

Moulidharan


Loader.
Up arrow icon