Upgraded a project with 365 CLI followed all the steps. (spfx project upgrade --output tour)
gulp serve --nobrowser works fine, the web part show OK
gulp bundle --ship Works OK
gulp package-solution --ship Errors:
[14:51:06] Verifying configuration... [14:51:06] Done! [14:51:06] [14:51:06] Normalizing solution information... [14:51:06] Attempting creating component definitions for {1} manifests [14:51:06] Created component definitions for {1} manifests [14:51:06] config.solution.features not set! Instead generating a feature for each component. [14:51:06] Creating feature for ECG Requester Inbox... [14:51:06] Done! [14:51:06] [14:51:06] Reading custom Feature XML... [14:51:06] Done! [14:51:06] [14:51:06] Validating App Package... [14:51:06] Done! [14:51:06] [14:51:06] Reading resources... [14:51:06] Done! [14:51:06] [14:51:06] Reading Sharepoint Assets & Creating XML... [14:51:06] Error - 'package-solution' sub task errored after 130 ms Cannot read property 'name' of undefined [14:51:06] 'package-solution' errored after 165 ms [14:51:06] [14:51:06] ==================[ Finished ]================== Error - 'package-solution' sub task errored after 130 ms Cannot read property 'name' of undefined [14:51:07] Project dpc-requester-inbox version:0.0.1 [14:51:07] Build tools version:3.12.1 [14:51:07] Node version:v10.16.0 [14:51:07] Total duration:5.25 s [14:51:07] Task errors:1 The build failed because a task wrote output to stderr. Exiting with exit code: 1
I ran o365$ spfx doctor --env spo and got "Error: spfx doctor doesn't support SPFx v1.11.0 at this moment"
What Should I do to make it work? Thank you
Would you mind sharing your package-solution.json before and after the upgrade?
I am also facing exactly same issue.
[23:14:49] Reading Sharepoint Assets & Creating XML...
[23:14:49] Error - 'package-solution' sub task errored after 175 ms
Cannot read property 'name' of undefined
[23:14:49] 'package-solution' errored after 196 ms
[23:14:49]
[23:14:50] ==================[ Finished ]==================
Error - 'package-solution' sub task errored after 175 ms
Cannot read property 'name' of undefined
[23:14:50] Project spfx-crud-angularjs version:0.0.1
[23:14:50] Build tools version:3.12.1
[23:14:50] Node version:v10.21.0
[23:14:50] Total duration:4.98 s
[23:14:50] Task errors:1
The build failed because a task wrote output to stderr.
Exiting with exit code: 1
Thank you for letting us know @crsukla 馃憤馃徎
Could share with us your package-solution.json before and after the upgrade?
2 things happened.
o365 spfx project upgrade -v1.11.0 returns "Error: Office 365 CLI doesn't support upgrading SharePoint Framework projects to version 1.11.0."gulp package-solution --ship and it was OK. What did you guys do to my computer :-)
Thanks anyway
package-solution - beforeAfter.zip
Thank you for the response @Ofer-Gal .
Can you re-run the upgrade command omitting the -v option and see if that works for you?
The spfx project upgrade command assumes that you will be upgrading to the latest version and that specifying a version is only required should you wish to upgrade to a specific version which is not the latest, please see the below excerpt from the Remarks section of the command docs.
The spfx project upgrade command helps you upgrade your SharePoint Framework project to the specified version. If no version is specified, the command will upgrade to the latest version of the SharePoint Framework it supports (v1.11.0).
Source: https://pnp.github.io/office365-cli/cmd/spfx/project/project-upgrade/
I think this is also related to this issue here in sp-dev-docs affecting SPFx v1.11.0
@Ofer-Gal I can't see any changes to package-solution.json. Do you have the list of steps that we could follow to reproduce the issue?
I experienced this issue myself without using the generator to upgrade. I quite simply:
1.10.0 to 1.11.0gulp clean && gulp bundle --ship && gulp package-solution --shipWhich causes package-solution to return the Cannot read property 'name' of undefined error. I believe this is a SPFx framework problem.
@JakeStanger, thanks. So just to double check: you've done the steps you mentioned manually, without using Office 365 CLI, correct?
Yep, just manually changed the package.json and ran yarn.
I suppose it's worth noting I've only tried SPFx 1.11.0 in a library component so far, I'm not sure what happens with webparts or extensions.
OK, I've been able to get it reproduced. It seems like, if you don't include the newly introduced _developer_ section in package-solution.json, packaging the project fails.
Since this isn't specific to Office 365 CLI, I'll close this issue and would suggest opening a new issue in the sp-dev-docs repo.
So yo conclude the developer section in package-solution.json is required in SPFx 1.11.0 ?
Yes, that seems to be the case. The official upgrade guidance in the SPFx docs should reflect that shortly.
Thanks
I upgraded to 2.12.0 then ran:
o365$ spfx project upgrade
and got "Project doesn't need to be upgraded"
everything is 1.10.0
What can be the problem?
Could it be that your .yo-rc.json file refers to 1.11.0 already?
Yep. Thanks
Most helpful comment
OK, I've been able to get it reproduced. It seems like, if you don't include the newly introduced _developer_ section in
package-solution.json, packaging the project fails.Since this isn't specific to Office 365 CLI, I'll close this issue and would suggest opening a new issue in the sp-dev-docs repo.