Sp-dev-docs: Generator doesn't check if the webpart name is valid

Created on 10 Feb 2017  路  4Comments  路  Source: SharePoint/sp-dev-docs

Category

  • [ ] Question
  • [ ] Typo
  • [x] Bug
  • [ ] Enhancement / Suggestion
  • [ ] Additional article idea

Expected or Desired Behavior

Running yo @microsoft/sharepoint and setting a webpart name, the webpart name should be validated before the project will be created.

Observed Behavior

Running yo @microsoft/sharepoint and setting a webpart name like "20170210Spfxrc0" will result in invalid class names.
gulp serve will fail with the following typescript errors.

Error - typescript - src\webparts\20170210Spfxrc0\20170210Spfxrc0WebPart.ts(13,2
2): error TS1005: '{' expected.
Error - typescript - src\webparts\20170210Spfxrc0\20170210Spfxrc0WebPart.ts(13,3
0): error TS1005: ';' expected.
Error - typescript - src\webparts\20170210Spfxrc0\20170210Spfxrc0WebPart.ts(13,4
5): error TS1005: ';' expected.
Error - typescript - src\webparts\20170210Spfxrc0\20170210Spfxrc0WebPart.ts(37,3
): error TS1005: ',' expected.
Error - typescript - src\webparts\20170210Spfxrc0\20170210Spfxrc0WebPart.ts(41,3
): error TS1005: ',' expected.

Steps to Reproduce

WIN 7
node v4.6.0
npm 3.10.10

generator fixed tracked bug-confirmed

All 4 comments

This is good feedback, thanks! We will investigate this problem and update this issue.

Confirmed this is still an issue in SPFx v1.7.0

Appears fixed... not throwing any errors in SPFx v1.9.1

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

nanddeepn picture nanddeepn  路  3Comments

SteIvanov picture SteIvanov  路  3Comments

waldekmastykarz picture waldekmastykarz  路  3Comments

StfBauer picture StfBauer  路  3Comments

acksoft picture acksoft  路  3Comments