Skip to content

How do we change the feature scope for an SPFx extension? #649

@chrisobriensp

Description

@chrisobriensp

Category

  • Question
  • Typo
  • Bug
  • Additional article idea

Expected or Desired Behavior

When creating an SPFx extension (e.g. application customizer), I expected to be able to change the feature scope when the feature is defined in package-solution.json. The default is a site/web scoped feature, but sometimes we may want a site collection-scoped feature.

Observed Behavior

There is no "scope" property of the feature node, and adding one makes the file fail to be validated against schema in the bundling/build process. The following error is observed:

ERROR: Error parsing file 'package-solution.json'
(#/solution/features/0) Additional properties not allowed: scope

Steps to Reproduce

  1. Create an application customizer using the steps outlined in the documentation at https://dev.office.com/sharepoint/docs/spfx/extensions/get-started/build-a-hello-world-extension.
  2. Add a "scope" child to a feature node in package-solution.json.
  3. Run gulp serve.

Here's an image which shows what I expected to do to change feature scope:

image

Can this be done? If so, how?

Thanks!

COB.

Metadata

Metadata

Assignees

No one assigned

    Labels

    status:trackedCurrently tracked with Microsoft’s internal issue tracking system. DO NOT ADD/REMOVE (MSFT managed)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions