-
Notifications
You must be signed in to change notification settings - Fork 304
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Custom Client-side web part not added to a page #62
Comments
What part is not working above? When you say same behavior, can you be more specific there are several things in the thread you linked. Thanks! |
It is a custom web part - for the sake of simplicity I've created an OOB HelloWorld web part. The web part is successfully found from the web part definitions and built with the code
However, when I add it to the page, it is rendered as a blank web part: According to the discussions in the linked bug, I have modified the Component's ID without brackets. Note that I've tried both with the original definition (with brackets) and without brackets. UPDATE 1: I've modified the ClientSidePageComponent object's Id property with toLowerCase() and it now appears. For now, I've implemented a method which fixes the Id of the web part |
So the guid from your custom component definition contains capital letters, meaning the id is as well. When you make them lower-case it then works? Can you share the code that "fixes" the issue? I'd like to get this resolved in the library if possible. |
Sure, it is quick and dirty code, but here it is: ` private fixClientSideWebPart(webpart: ClientSidePageComponent): ClientSidePageComponent { |
I can inside of the fromComponentDef method make these adjustments when I set the id. So perhaps that will be enough. Thanks for sharing the code. |
This issue is locked for inactivity or age. If you have a related issue please open a new issue and reference this one. Closed issues are not tracked. |
Related article: https://pnp.github.io/pnpjs/sp/client-side-pages.html
Category
Version
Versions tested with- 1.0.2 and 1.0.3
Expected / Desired Behavior / Question
Expecting that the web part is added to the provisioned page
Observed Behavior
Web part is not added for some reason. The same behaviour as described here is observed: #14
Steps to Reproduce
`btn.addEventListener("click", async evt => {
});`
The text was updated successfully, but these errors were encountered: