SPFx extension samples not showing
Category
- [x] Question
- [ ] Typo
- [ ] Bug
- [ ] Additional article idea
Expected or Desired Behavior
To see the extension samples when executing gulp serve
Observed Behavior
I've tried several samples SPFx extensions. All samples have the same outcome when it comes to testing (gulp serve) after following the instructions on the samples page. Most of them just require npm install and adjustments in the serve.json file. However, every time I'm testing it, the extension somehow is not loaded. I won't get an error or anything, but it just doesn't load/execute.
Even when I'm following the helloworld tutorial on the official tutorial series, the extension won't show (except the alert from the very first step).
I also tried on different machines and in different networks, but I was never able to get the samples to do something.
Does anyone have an idea?
Steps to Reproduce
Download the sample js-command-clone, run npm install in a console and adjust config/serve.json with a list view of your choice. Run gulp serve
Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.
Hi @isabasu
Thanks for submitting your question. Could you provide a little more detail around your specific environment. Are you testing this with SPO or OnPrem? What version of SPFx are you testing with?
I also noticed the tutorial sample you linked to was for the sample web part, but your title mentions using extensions.
Did you happen to try using the tutorial found here: https://docs.microsoft.com/en-us/sharepoint/dev/spfx/extensions/get-started/build-a-hello-world-extension
:)
Thanks for your quick answer.
Sorry about the link - I adjusted it in the original post. I meant this one => https://docs.microsoft.com/en-us/sharepoint/dev/spfx/extensions/get-started/using-page-placeholder-with-extensions
I'm testing with SharePoint Online in the serve.json file.
Node.js version: 10.15.3 npm version: 6.4.1 gulp version: 2.1.0
Thanks @isabasu
I'm not sure if its the only issue causing your ext to not work, but SPFx hasn't upgraded to Node 10.x support.
Best to double check and ensure your development environment is setup in alignment with what's documented here: https://docs.microsoft.com/en-us/sharepoint/dev/spfx/set-up-your-development-environment
:)
Thanks for the hint. I just tried it with node version 8.15 on one computer and with node version 8.12 on another. Same behavior. Unfortunately, this is happening for all the samples I've tried so far.
I assume the following actions are correct since it says on almost all samples that the "minimal path to awesome" is the following:
- Copy the sample folder
- Adjust the serve.json according to my tenant
- Navigate into the folder within powershell
- Enter
npm install - Use
gulp serveto test.
Thanks for your time and help :)
Node 10 shouldn't be the issue. What happens with gulp serve? Does it build correctly? Does a browser pop up? What's the URL of it? etc.
Gulp serve opens up the browser correctly and redirects me to
https://mytenant.sharepoint.com/sites/mysite?loadSPFX=true&debugManifestsFile=https://localhost:4321/temp/manifests.js&customActions={"bf6645bd-42e4-4a30-aad7-6ff12d61fa1f":{"location":"ClientSideExtension.ListViewCommandSet"}}
Looks like by the customActions guid, you are testing out the 'js-command-clone' sample that you had referenced in a previous comment. I just pulled down this sample and tested it myself and it seems to work for me.
I did notice that your URL was not pointing at a list though? This is a ListView extension and based on the code in the sample will work when you test it within a list and select a list item.
So here is the URL that works for me:
https://MyTenant.sharepoint.com/sites/MySITE/Lists/CloneCommand/AllItems.aspx?debugManifestsFile=https://localhost:4321/temp/manifests.js&loadSPFX=true&customActions={"bf6645bd-42e4-4a30-aad7-6ff12d61fa1f":{"location":"ClientSideExtension.ListViewCommandSet","properties":{}}}
Here is a screen snippet of how I was able to get it to activate:

My list is a simple list I just created and added just one list item and selected it.
If you do the same, does the "Clone" button show up for you? :)
Hi @PopWarner
Thanks for testing it out and letting me know. I realized I had a different URL in my clipboard, but it was actually redirecting me to the following URL:
https://MYTENANT.sharepoint.com/sites/MYSITE/Lists/MYLIST/AllItems.aspx?debugManifestsFile=https%3A%2F%2Flocalhost%3A4321%2Ftemp%2Fmanifests.js&loadSPFX=true&customActions=%7B%22bf6645bd-42e4-4a30-aad7-6ff12d61fa1f%22%3A%7B%22location%22%3A%22ClientSideExtension.ListViewCommandSet%22%2C%22properties%22%3A%7B%7D%7D%7D
When I tried it again today, I actually got the following message the first time I opened it:
Error loading debug script. Ensure the server is running and the "debugManifestFile" parameter URL is correct.
Error: Script error for "https://localhost:4321/temp/manifests.js" http://requirejs.org/docs/errors.html#scripterror
When I try your URL the clone function works perfectly fine which is great. So I thought I'll give it another try with simply gulp serve and it worked seemlessly.
Since this was kinda weird I completely deleted the js-command-clone extension and tried everything again. I realized that gulp serve won't work, but as soon as I add the "debug URL" manually from the sample instructions it is working. From this moment onwards also gulp serve works.
Any idea why that is? I assume it has something to do with the error message I received regarding the debugManifestFile?
Thanks again! :-)
@PopWarner Any idea why that is or how to prevent it?
@isabasu, my apologies for the delay in responding.
Normally I get that error if the "gulp serve" has not been executed and the localhost instance of the SPFx solution is not running.
Or it could also be your running the gulp serve, but the browser has not trusted the path for your localhost instance.
Before testing your extension, perhaps first try navigating directly to: https://localhost:4321 and check for any issues starting there? :)
@PopWarner No worries at all. I'm thankful for your responses :-)
I added localhost to my trusted sites and also tried to access https://localhost:4321 after gulp serve. I can access https://localhost:4321 (listing directory), but I still get the error message mentioned above with gulp serve.
Some of my colleagues tried it as well with the same outcome. May I know what versions you're running? I really can't tell anymore what else could be the cause of all this :/
Hmmm. I’m a little confused. Is it no longer working for you?
In one of your recent messages you said when you paste a properly formatted URL, it was working for you?
I think, if I understand accurately that you said when you let the gulp serve open the browser it doesn’t work, but when you paste in a URL, it does? (I might be wrong in my understanding, so forgive me if I am wrong.)
Have you also tested in multiple browsers to see if it’s a browser specific problem perhaps?
@PopWarner
Sorry for any confusions caused. Well yeah, it used to work when I took "your" URL, that is true. However, since this is super strange and is probably also the cause of why other extensions are not properly working, I went ahead and did it all over again.
That means:
- Downloaded and extracted js-command-clone
npm installin that folder- Adjusted serve.json with this link: https://MYTENANT.sharepoint.com/sites/MYSITE/Lists/MYLIST/AllItems.aspx
gulp serve
That is causing again this error message from above (including the manifests.js file) to show up. When I use your URL it doesn't work anymore as it did before. For whatever reason... So I did it again on another machine with the same result.
I did another test with react-application-breadcrumb which has the same behavior.
@isabasu and in that process if you load the https://localhost:4321 URL it loads ok? After that, if you try the pasted URL, does it still fail?
Also, in the process of your steps 1-4, when your URL from step 3 loaded, did you still get the "Error: Script error for "https://localhost:4321/temp/manifests.js" error?
@PopWarner Thanks for getting back to me and I appreciate your time!
Today morning I just tried it again (no changes have been done since yesterday).
Actions taken today morning (checkmark indicates success/no checkmark failure):
- [x] Accessing https://localhost:4321 after
gulp servefor js-command-clone - [ ] Accessing https://localhost:4321 after
gulp serve-info --nobrowserfor react-application-breadcrumb - [x] Extension works for js-command-clone
- [ ] Extension works for react-application-breadcrumb
I feel like this is super strange. Since my last test yesterday I didn't change anything and back then it didn't work. Today morning, first thing, I just tried gulp serve (respectively gulp serve-info --nobrowser according to the react-application-breadcrumb tutorial - it goes without saying that I opened up a browser as well and added the debug link from the tutorial to my URL), again as mentioned in the actions and it worked (at least for js-command-clone)
As for your other question: Yes, for the react-application-breadcrumb I did still get the same message.
Hmmm. Are you on ‘Targeted Release’?
I know there has been some issues the last few days with command set ext for those on Targeted Release, but believe it’s been fixed. That could have been part of the issue of you seeing it work and then not and now work again.
So sounds like your good to there for the clone sample.
I had not tested the react sample myself, but can later tonight or over the weekend. Does a brand new ext or other samples work for you? :)
Indeed we're on Targeted Release - on both tenants I've tried with. Maybe they haven't pushed the fix to our tenants yet - I'll try next week again with the same steps.
Oh that'd be super nice of you if you could test it as well :-)
Other samples mostly have the same behavior or another issue. However, I tested around 6-7 extenions so far and got only the clone one to work yet. I'll go ahead and test some more this weekend/next week and check if they all end up with the same manifests.js error. Will keep you posted :-)
Thanks again for your time so far!
My pleasure. Thanks for your patience on working through it. :)
@PopWarner Thanks again.
I've tested some of the extensions with the following outcome. The ones which didn't work couldn't reach https://localhost:4321 nor https://localhost:5432:
- [x] jquery-application-toastr
- [x] Js-command-selectedItems-export
- [x] Jquery-command-copy-classic-link | didn't work at first try with
gulp serve --config=copyClassicLinkToastrso I tried withgulp serve --config=copyClassicLinkSwalwhich worked. Then I tried againgulp serve --config=copyClassicLinkToastrimmediately after and it worked - [ ] jquery-field-itemorder | manifests.js error
- [ ] Js-command-item-permissions | Manifests.js error
- [ ] React-application-breadcrumb | Manifests.js error
- [ ] React-application-duetasks | Manifests.js error
I assume all these are due to one cause: localhost not reachable. However, do you have an idea why it wouldn't be reachable? I was following the instructions of all of them on the samples pages.