Sp-dev-docs: 1.9.1 @microsoft/generator-sharepoint no longer asking for Baseline packages

Created on 9 Oct 2019  路  4Comments  路  Source: SharePoint/sp-dev-docs

Category

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

Expected or Desired Behavior

When running yo @microsoft/sharepoint, it would ask for _"Which baseline packages do you want to target for your components(s)?"_ as second question.

Observed Behavior

It doesn't ask for the baseline packages, but instead defaults to on-prem settings.

PS C:\git> yo @microsoft/sharepoint

     _-----_
    |       |    .--------------------------.
    |--(o)--|    |      Welcome to the      |
   `---------麓   |  SharePoint Client-side  |
    ( _麓U`_ )    |    Solution Generator    |
    /___A___\    '--------------------------'
     |  ~  |
   __'.___.'__
 麓   `  |掳 麓 Y `

Let's create a new SharePoint solution.
? What is your solution name? SharePoint.SPFx.HttpFetch
? Where do you want to place the files? Create a subfolder with solution name
Found npm version 6.4.1
? Which type of client-side component to create? WebPart
Add new Web part (on-prem) to solution share-point-sp-fx-http-fetch.
? What is your Web part (on-prem) name? HttpFetch
? What is your Web part (on-prem) description? HttpFetch description
? Which framework would you like to use? No JavaScript framework

Steps to Reproduce

  1. Install 1.9.1 version of @microsoft/generator-sharepoint
  2. Run yo @microsoft/sharepoint

Workaround

  1. Use --environment parameter when calling yo: yo @microsoft/sharepoint --environment "spo"
generator answered question

Most helpful comment

Hi @jpalo

Sounds like you may have initiated the command in an existing SPFx solution folder, and/or there is an existing .yo-rc.json file higher up in your folder structure. (SPFx solutions allow you add multiple webparts/extensions to a single SPFx project)

So if there is an existing .yo-rc.json file, it will re-use that configuration... instead of asking you to select an environment.

All 4 comments

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

Hi @jpalo

Sounds like you may have initiated the command in an existing SPFx solution folder, and/or there is an existing .yo-rc.json file higher up in your folder structure. (SPFx solutions allow you add multiple webparts/extensions to a single SPFx project)

So if there is an existing .yo-rc.json file, it will re-use that configuration... instead of asking you to select an environment.

Thank you very much for pointing out this "user error", I had apparently created SPFx project to the root some time earlier by mistake and didn't realize it. 馃槉

Issues that have been closed & had no follow-up activity for at least 7 days are automatically locked. Please refer to our wiki for more details, including how to remediate this action if you feel this was done prematurely or in error: Issue List: Our approach to locked issues

Was this page helpful?
0 / 5 - 0 ratings

Related issues

StfBauer picture StfBauer  路  3Comments

christianbueschi picture christianbueschi  路  3Comments

zerovectorspace picture zerovectorspace  路  3Comments

patrick-rodgers picture patrick-rodgers  路  3Comments

karishmaTCS picture karishmaTCS  路  3Comments