Description
Noticed while using spfx project upgrade using --shell powershell it sets wrong file contents for the config/sass.schema.json file.
When looking at the upgrade report I have the following step:
@"
{
"$schema": "https://developer.microsoft.com/json-schemas/core-build/sass.schema.json"
}
"@ | Out-File -FilePath "config\sass.json"
Resulting in the file having this as file content:
{
"": "https://developer.microsoft.com/json-schemas/core-build/sass.schema.json"
}
Because PowerShell thinks $schema is a variable, the property name becomes empty. We should escape the $ in the $schema property name.
Steps to reproduce
Upgrade an old project (with no sass.schema.json file) to the newest version, for me I used a v1.13.1 project and upgraded it to v1.16.1.
Expected results
Project to build
Actual results
Build target: DEBUG
Error: JSON validation failed:
C:\project\config\sass.json
Diagnostics
No response
CLI for Microsoft 365 version
v6.4.0
nodejs version
v16.18.1
Operating system (environment)
Windows
Shell
PowerShell
cli doctor
No response
Additional Info
No response
Description
Noticed while using
spfx project upgradeusing--shell powershellit sets wrong file contents for theconfig/sass.schema.jsonfile.When looking at the upgrade report I have the following step:
Resulting in the file having this as file content:
{ "": "https://developer.microsoft.com/json-schemas/core-build/sass.schema.json" }Because PowerShell thinks
$schemais a variable, the property name becomes empty. We should escape the$in the$schemaproperty name.Steps to reproduce
Upgrade an old project (with no
sass.schema.jsonfile) to the newest version, for me I used av1.13.1project and upgraded it tov1.16.1.Expected results
Project to build
Actual results
Build target: DEBUG
Error: JSON validation failed:
C:\project\config\sass.json
Diagnostics
No response
CLI for Microsoft 365 version
v6.4.0
nodejs version
v16.18.1
Operating system (environment)
Windows
Shell
PowerShell
cli doctor
No response
Additional Info
No response