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

Web part is not available on the modern page despite of the deployment on the site. #5318

Closed
1 of 9 tasks
Ajay196488 opened this issue Oct 25, 2024 · 7 comments
Closed
1 of 9 tasks

Comments

@Ajay196488
Copy link

Disclaimer

Yes

Sample

react-script-editor

Contributor(s)

@Mikael Svenson, Felix Bohnacker, salascz, Waldek Mastykarz, Luccas Castro

What happened?

Web part is not available on the modern page. I have used the latest version of the web part.

Steps to reproduce

  1. Add the webpart in app the catalog.
  2. Add the app on the site.
  3. Webpart is not showing on the Modern page

Expected behavior

It should be available on the modern pages.

Target SharePoint environment

SharePoint Online

Developer environment

None

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?

18

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

18

Paste the results of SPFx doctor

image

Additional environment details

No response

@Ajay196488 Ajay196488 added the type:bug-suspected Suspected bug (not working as designed/expected). See type:bug-confirmed for confirmed bugs label Oct 25, 2024
@Adam-it
Copy link
Member

Adam-it commented Oct 27, 2024

@Ajay196488 I think this webpart shows up when custom scripts is enabled on sites.
could you enable it for your site and recheck
image

if you want to enable it for all sites also for no-script sites you need to set the following as it is stated in protect readme
image

@hugoabernier hugoabernier added sample: react-script-editor and removed type:bug-suspected Suspected bug (not working as designed/expected). See type:bug-confirmed for confirmed bugs labels Oct 28, 2024
@hugoabernier
Copy link
Collaborator

Hi @Ajay196488, were you able to resolve this issue?

I'll go ahead and close this, but if you have more questions, please do not hesitate to open a new issue and provide more information.

@tedtninety
Copy link

@Ajay196488 Thank you.

Will I be able to rely on using this solution to customize select pages using Modern Script Editor? After all it was created with SPFX by the awesome Mikael, or is this something that is on MS roadmap to sunset?

I had read somewhere about having to renew something by script every 24 hrs to keep the webpart functioning after this week?

@Adam-it
Copy link
Member

Adam-it commented Nov 17, 2024

@Ajay196488 Thank you.

Will I be able to rely on using this solution to customize select pages using Modern Script Editor? After all it was created with SPFX by the awesome Mikael, or is this something that is on MS roadmap to sunset?

I had read somewhere about having to renew something by script every 24 hrs to keep the webpart functioning after this week?

@tedtninety I would recommend not relying on this approach to do regular customization of Modern SharePoint Pages. Custom scripting is by default turned of and only few classic pages has it turned on. You may of course turn on custom scripting on your own but it will only last for 24 after that you will need to switch it back on again.
You may read more about it here
https://learn.microsoft.com/en-us/sharepoint/allow-or-prevent-custom-script

image

@tedtninety
Copy link

@Ajay196488 Thank you.
Will I be able to rely on using this solution to customize select pages using Modern Script Editor? After all it was created with SPFX by the awesome Mikael, or is this something that is on MS roadmap to sunset?
I had read somewhere about having to renew something by script every 24 hrs to keep the webpart functioning after this week?

@tedtninety I would recommend not relying on this approach to do regular customization of Modern SharePoint Pages. Custom scripting is by default turned of and only few classic pages has it turned on. You may of course turn on custom scripting on your own but it will only last for 24 after that you will need to switch it back on again. You may read more about it here https://learn.microsoft.com/en-us/sharepoint/allow-or-prevent-custom-script

image

Thank you @Adam-it ( apologies I tagged you incorrectly prior ).

"This setting affects all sites. There are no options to preserve changes to custom script settings only on some specific sites. This parameter will be available until November 2024. After that date, it will no longer be possible to prevent SharePoint in resetting custom script settings to its original value for all sites. "

To clarify, this ability will only work until November 2024, regardless of whether the persistent script was run or not?

So there is no way otherwise to customize modern pages with CSS?

@Adam-it
Copy link
Member

Adam-it commented Nov 17, 2024

@tedtninety I think you may always apply custom css using SPFx extension like an application customizer

@tedtninety
Copy link

@tedtninety I think you may always apply custom css using SPFx extension like an application customizer

Thank you @Adam-it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants