Skip to content
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

Adding react-pages-hierarchy webpart with pnp powershell doesn't work correctly #5341

Open
1 of 9 tasks
lkmnch opened this issue Nov 11, 2024 · 3 comments
Open
1 of 9 tasks
Labels
type:bug-suspected Suspected bug (not working as designed/expected). See type:bug-confirmed for confirmed bugs

Comments

@lkmnch
Copy link

lkmnch commented Nov 11, 2024

Disclaimer

Yes

Sample

https://github.com/pnp/sp-dev-fx-webparts/tree/main/samples/react-pages-hierarchy

Contributor(s)

@bogeorge @techienickb @tmaestrini

What happened?

When attempting to add the "react-pages-hierarchy" WebPart to a SharePoint page using PnP PowerShell, it initially appears on the client side. However, if I add another WebPart to the same page afterward, the "react-pages-hierarchy" WebPart vanishes.

Observed Behavior:

  • The "react-pages-hierarchy" WebPart is not listed in page.controls when added through PnP PowerShell.
  • Other WebParts added via PnP PowerShell appear correctly in page.controls.
  • When the "react-pages-hierarchy" WebPart is added manually through the SharePoint client, it is listed in page.controls and functions as expected.

How I add the Webpart with PnP Powershell:

Add-PnPPageWebPart -Page $pageName -Component "Page Hierarchy" -Section 1 -Column 1

Steps to reproduce

  1. Add the "react-pages-hierarchy" WebPart to a SharePoint page using PnP PowerShell.
  2. Verify that the WebPart is displayed correctly on the client side.
  3. Add another WebPart to the page (e.g., using the client or PnP PowerShell).
  4. Observe that the "react-pages-hierarchy" WebPart disappears from the client view.

Expected behavior

The "react-pages-hierarchy" WebPart should be added to page.controls and persist on the page, similar to other WebParts added via PnP PowerShell.

Target SharePoint environment

SharePoint Online

Developer environment

Windows

Browsers

  • Internet Explorer
  • Microsoft Edge
  • Google Chrome
  • FireFox
  • Safari
  • mobile (iOS/iPadOS)
  • mobile (Android)
  • not applicable
  • other (enter in the "Additional environment details" area below)

What version of Node.js is currently installed on your workstation?

v18.20.3

What version of Node.js is required by the sample?

18

Paste the results of SPFx doctor

I am unable to provide the results of m365 spfx doctor -o text due to environment restrictions. If this information is crucial for resolving the issue, please let me know, and I can try to provide additional relevant details about my SPFx environment manually.

Additional environment details

No response

@lkmnch lkmnch added the type:bug-suspected Suspected bug (not working as designed/expected). See type:bug-confirmed for confirmed bugs label Nov 11, 2024
@tmaestrini
Copy link

@reshmee011 good morning! Thought of you and wanted to ask if you have any idea why the webpart won't get registered when using the PowerShell cmdlet to add the webpart via code?

@reshmee011
Copy link
Contributor

@tmaestrini : I will need to investigate on this one.

@tmaestrini
Copy link

Thank you very much! Please let me know what you've found out.
I want to discover if it's related to an erroneous setup of the webpart (for example duplicated guid or so) or the PoSh cmdlet...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug-suspected Suspected bug (not working as designed/expected). See type:bug-confirmed for confirmed bugs
Projects
None yet
Development

No branches or pull requests

3 participants