Sp-dev-docs: Adding Application Customizer to existing Web Part Project causes web parts to not be deployed

Created on 8 Jan 2019  路  8Comments  路  Source: SharePoint/sp-dev-docs

Category

  • [ ] Question
  • [ ] Typo
  • [x] Bug
  • [ ] Additional article idea

Expected or Desired Behavior

This issue occurs when adding an application customizer using yo to an existing SPFx project that has a web part in it. When you add the application customizer, the Web Parts are no longer deployed.

Observed Behavior

After the application customizer is added to the project, the Web Part is no longer deployed (the application customizer is deployed).

Steps to Reproduce

  1. Create a new SPFx project (occurs in 1.6 and 1.7) with a web part. Default settings are fine.
  2. Deploy your project, verify that the web parts is present.
  3. Use yo to add an application customizer to the project.
  4. Increment version in package-solution.json
  5. Deploy new version to app catalog an install update on your site.
  6. The application customizer will be present. The web parts will no longer be deployed.

GitHub Repo

My repo below shows the issue.
https://github.com/coreyroth/WebPartPlusAppCustomizer/blob/master/README.md

Recommendations

This is caused by the fact that web parts do not require a feature entry in package-solution.json. When you add an application customizer, it creates a feature entry and then the web parts are not deployed. In this case, when you run yo to add the application customizer, it should add the component ids of any existing web part to the feature.

Warnings should also be provided to users as to avoid having multiple features which causes issues with the wrong version of code being loaded as shown in issue #3199.

spfx-extensions spfx-general tracked

Most helpful comment

I'll answer on the question... the sample which @coreyroth provided is not using tenant scoped deployment (aka skip feature activation) and therefore requires a solution to be installed on a site. Basically, a developer is looking to deploy two web parts and one application extension to a single site. That should work and we'll absolutely need to have a look at this.

All 8 comments

Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.

Here is a post detailing the work-around for when this occurs.

@coreyroth - were you using the 'skip feature activation' flag or not?

I'll answer on the question... the sample which @coreyroth provided is not using tenant scoped deployment (aka skip feature activation) and therefore requires a solution to be installed on a site. Basically, a developer is looking to deploy two web parts and one application extension to a single site. That should work and we'll absolutely need to have a look at this.

I just fell into this trap as well.

The link to the work-around that @coreyroth posted does not work.
Any suggestions for getting info on the work-around?

/Leif

Hi,

Any update on this issue ?

@coreyroth: Here is a post detailing the work-around for when this occurs.

Unfortunately, the link is broken now. Have you moved the blogpost to your new site? If so, could you please update the link?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ken-harris picture ken-harris  路  3Comments

waldekmastykarz picture waldekmastykarz  路  3Comments

patrick-rodgers picture patrick-rodgers  路  3Comments

waldekmastykarz picture waldekmastykarz  路  3Comments

christianbueschi picture christianbueschi  路  3Comments