SPFx extension missing from yeoman.

Brass Contributor

Hello,

 

I am trying to build a SPFx extension for SharePoint online. When using Yeoman generator, I am not getting option to create a project for extension. Only option available in webpart.

 

Node version :- v8.12.0

npm version :- 6.4.1

SharePoint generator version:- 1.6.0

 

See attached screen shot for options.

 

Anyone has faced similar issue?

 

yoemn-error.png

9 Replies

Can you verify which version of the generator you're using by executing:

 

 

npm ls -g --depth=0 @microsoft/generator-sharepoint

 

 

After executing the above command, I get below result

`-- @Pernille-Eskebo/generator-sharepoint@1.6.0

The other thing which I noticed is that, target environment option is missing when creating the project using Yoeman. I tried uninstalling Yoeman and SharePoint generator and installed back. Still same issue. Thoughts?

I cleaned up the parent folder which has app the dependencies added to it and started from scratch. It worked fine. I am not able to see all the options. Looks like it was referencing something from parent folder and skipping the option to select SharePoint online or SharePoint 2016.

 

Thanks for your help.

 

I tried to do some more research and found that .yo-rc.json was having below configurations. Since the environment is onprem thats why extensions were not showing. The Yoeman was referring this file while creating the new solution. 

{
"@microsoft/generator-sharepoint": {
"isCreatingSolution": true,
"environment": "onprem",
"version": "1.6.0",
"libraryName": "app-extension",
"libraryId": "c10653e7-a74c-4001-a1d9-ab6e3a778a60",
"packageManager": "npm",
"componentType": "webpart"
}
}

@Rishi Gupta  hello Rishi, I'm facing the same issue. I have NodeJs v10.16.0 and sharepoint-generator v1.8.2.

 

I've been trying to find this configuration (the one you posted) to check if I have the same, but I can't find it:

 

{
"@microsoft/generator-sharepoint": {
"isCreatingSolution": true,
"environment": "onprem",
"version": "1.6.0",
"libraryName": "app-extension",
"libraryId": "c10653e7-a74c-4001-a1d9-ab6e3a778a60",
"packageManager": "npm",
"componentType": "webpart"
}
}
 
I've uninstalled the generator, and re-installed, but still the same, can you point me where is exactly this file? Thanks
 
UPDATE: Just in case someone is using this tool. I've realized that if I use the Powershell Console, I have the "Extension" option and I can create it. However, if I use Cmder.exe that opcion is not available. I will not waste my time trying to find a solution to this, I prefeer to use PS

@Rishi Gupta I found in available only if i choose 2019 onward...

Maybe it will help someone - in my case the issue was related to the settings in .yo-rc.json file. I had the option "isDomainIsolated": true - after removing it, additional options appeared: WebPart, Extension, Library, Adaptive Card Extension.
Answer from the thread below helped to figure it out:
https://learn.microsoft.com/en-us/answers/questions/885608/extension-is-missing-from-which-type-of-c...