SPFx Webpart With Angular Elements not working in SharePoint page

Meet Bhatt 21 Reputation points
2021-04-06T04:38:20.007+00:00

Hello Everyone,

I have created a demo of SPFx Webpart With Angular Elements with reference to this link.

I have successfully bundle that project and serve that project with "npm run bundle" and "gulp serve" commands.

It is running correctly in workbench / local. Please refer to below screenshot,
84640-ss.png

When I have published that solution using "gulp bundle --ship" and "gulp package-solution --ship" commands. .sppkg file has been generated successfully. But when I add that app to my SharePoint page it throws a below error,

84762-sss.png

If anyone has an idea for the same. Please let me know.

Thanks in Advance.

Microsoft 365 and Office | SharePoint | For business | Windows
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Amos Wu-MSFT 4,131 Reputation points Moderator
    2021-04-06T07:50:51.713+00:00

    I followed the steps of the blog to create and publish SPFX, and it works well.
    84760-image.png
    According to your screenshot, your SPFX webpart was successfully rendered, but the data does not seem to be received. You could print or debug the code where you obtained the data to see if the data was successfully returned. Before running the packaging command, I suggest you run gulp clean first, then run npm install, and finally run the packaging command.


    If the response is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.