NoComponentId error
I am trying to create modern page and add web parts programmatically through extensions. when i run the code for the first time page is getting created succesfully and webparts are added to it. however, when i delete that page and re-run the code i am getting NoComponentId error.

I am not sure what went wrong. Please let me know if you have any idea.
Maybe that error refers to the ClientSideApplicationId column in the library where the page is hosted. It might get emptied during your process of recreating the page.
Hello @veeramanx and thanks for your feedback. Have you tried following frevds' advice? This error seems to come from the lack of an application id in the list item.
If this is not the case, would you mind sharing a few details on what does your code do?
Check the URL parameters as well. This error is caused when using the URL parameters "List" or "ID". ClientSidePages must not be called with these parameters in the URL (if you plan to make a custom form page where SharePoint redirects to your page, you need to have an intermediate page renaming those parameters, extremely stupid, this). They interprete this in a non-standard way as the page being in a different document library specified by List and being the document item with the specified ID (even though this mechanism exists, it is not possible to host ClientSidePages anywhere else but in the SitePages library, at least if you want to edit them, they always get published/saved there).
Closing this issue as frevds has provided steps to solving the problem and there has been no activity since then.
Issues that have been closed & had no follow-up activity for at least 7 days are automatically locked. Please refer to our wiki for more details, including how to remediate this action if you feel this was done prematurely or in error: Issue List: Our approach to locked issues