Running the project upgrade command on a 1.7.1 project to get 1.8.2 doesn't suggest an update to the resolutions section of package.json.
Package.json contains:
"resolutions": {
"@types/react": "16.4.2"
},
Command output:
o365$ spfx project upgrade
Execute in command line
-----------------------
npm i @microsoft/[email protected] @types/[email protected] @types/[email protected] @microsoft/[email protected] @microsoft/[email protected] @microsoft/[email protected] [email protected] [email protected] [email protected] -SE
npm i @microsoft/[email protected] @microsoft/[email protected] @microsoft/[email protected] @microsoft/[email protected] @microsoft/[email protected] @microsoft/[email protected] -DE
npm dedupe
./.yo-rc.json
-------------
Update version in .yo-rc.json:
{
"@microsoft/generator-sharepoint": {
"version": "1.8.2"
}
}
./tsconfig.json
---------------
Update tsconfig.json extends property:
{
"extends": "./node_modules/@microsoft/rush-stack-compiler-2.9/includes/tsconfig-web.json"
}
Update tsconfig.json inlineSources value:
{
"compilerOptions": {
"inlineSources": false
}
}
Update tsconfig.json strictNullChecks value:
{
"compilerOptions": {
"strictNullChecks": false
}
}
Update tsconfig.json noUnusedLocals value:
{
"compilerOptions": {
"noUnusedLocals": false
}
}
I expected a suggestion to update package.json to:
"resolutions": {
"@types/react": "16.7.22"
}
Thanks for reporting the issue and the repro steps. I'll have a look if I can reproduce the issue and get back to you as soon as I know more.
I've just tried running the upgrade command on a React web part built using v1.7.1 and I'm getting the recommendation as expected. Could you please try again on a new project so that we can see if it's working there and see if there is anything specific about your other project that cause this command to work incorrectly?
I reinstalled SPFx 1.7.1, created a new project with all the defaults (except that I selected React, of course). This is the output from the spfx project upgrade command:
Execute in command line
-----------------------
npm i @microsoft/[email protected] @microsoft/[email protected] @microsoft/[email protected] @microsoft/[email protected] @types/[email protected] @types/[email protected] [email protected] [email protected] -SE
npm i @microsoft/[email protected] @microsoft/[email protected] @microsoft/[email protected] @microsoft/[email protected] @microsoft/[email protected] @microsoft/[email protected] -DE
npm dedupe
./.yo-rc.json
-------------
Update version in .yo-rc.json:
{
"@microsoft/generator-sharepoint": {
"version": "1.8.2"
}
}
./tsconfig.json
---------------
Update tsconfig.json extends property:
{
"extends": "./node_modules/@microsoft/rush-stack-compiler-2.9/includes/tsconfig-web.json"
}
Update tsconfig.json inlineSources value:
{
"compilerOptions": {
"inlineSources": false
}
}
Update tsconfig.json strictNullChecks value:
{
"compilerOptions": {
"strictNullChecks": false
}
}
Update tsconfig.json noUnusedLocals value:
{
"compilerOptions": {
"noUnusedLocals": false
}
}
src\webparts\helloWorld\HelloWorldWebPart.manifest.json
-------------------------------------------------------
Update the supportedHosts property in the manifest:
{
"supportedHosts": ["SharePointWebPart"]
}
src\webparts\helloWorld\HelloWorldWebPart.ts
--------------------------------------------
Refactor the code to import property pane property from the @microsoft/sp-property-pane npm package instead of the @microsoft/sp-webpart-base package:
import { BaseClientSideWebPart } from "@microsoft/sp-webpart-base";
import { IPropertyPaneConfiguration, PropertyPaneTextField } from "@microsoft/sp-property-pane";
I'm executing on Windows, that might be the issue ;)
I'll go check on macOS, but it'll take some time.
Output on macOS on a newly created project:
o365$ spfx project upgrade
Execute in command line
-----------------------
npm i @microsoft/[email protected] @microsoft/[email protected] @microsoft/[email protected] @microsoft/[email protected] @types/[email protected] @types/[email protected] [email protected] [email protected] -SE
npm i @microsoft/[email protected] @microsoft/[email protected] @microsoft/[email protected] @microsoft/[email protected] @microsoft/[email protected] @microsoft/[email protected] -DE
npm dedupe
./.yo-rc.json
-------------
Update version in .yo-rc.json:
{
"@microsoft/generator-sharepoint": {
"version": "1.8.2"
}
}
./tsconfig.json
---------------
Update tsconfig.json extends property:
{
"extends": "./node_modules/@microsoft/rush-stack-compiler-2.9/includes/tsconfig-web.json"
}
Update tsconfig.json inlineSources value:
{
"compilerOptions": {
"inlineSources": false
}
}
Update tsconfig.json strictNullChecks value:
{
"compilerOptions": {
"strictNullChecks": false
}
}
Update tsconfig.json noUnusedLocals value:
{
"compilerOptions": {
"noUnusedLocals": false
}
}
src/webparts/helloWorld/HelloWorldWebPart.manifest.json
-------------------------------------------------------
Update the supportedHosts property in the manifest:
{
"supportedHosts": ["SharePointWebPart"]
}
src/webparts/helloWorld/HelloWorldWebPart.ts
--------------------------------------------
Refactor the code to import property pane property from the @microsoft/sp-property-pane npm package instead of the @microsoft/sp-webpart-base package:
import { BaseClientSideWebPart } from "@microsoft/sp-webpart-base";
import { IPropertyPaneConfiguration, PropertyPaneTextField } from "@microsoft/sp-property-pane";
I can reproduce the issue. Let me investigate it further and see what's wrong. Thanks for reporting!
Fix for this bug is available in v1.20.0 which should be available in the next few mins
Most helpful comment
Fix for this bug is available in v1.20.0 which should be available in the next few mins