A free program from Microsoft that provides developers with the tools, resources, and sandbox environments needed to build solutions for Microsoft 365.
Hi @SXD
Based on a similar recent Microsoft Q&A thread, this behavior has been observed specifically when Copilot generates React/JSX code. In that thread, the issue occurred in both the Copilot app and browser, while other programming languages worked normally.
As a temporary workaround, you can ask Copilot to put a Z at the beginning of each JSX line and provide the code as well. The user in that thread mentioned that this can sometimes prevent the error from occurring. You can then review the generated code and use Copy Code from the three-dot menu. However, this is only a workaround, the renderer may still omit part of the code.
Since this appears to be a recurring issue with Copilot when generating React/JSX content, I recommend raising the issue in the relevant Microsoft GitHub repository, including the error screenshot, a sample prompt that reproduces the issue, whether it occurs in both the app and browser. This should give the relevant development team enough information to investigate the issue.
Reference: Participating in a discussion - GitHub Docs
If possible, please share the GitHub issue link here once you have submitted it, so that others experiencing the same problem can follow the issue and any updates from the development team.