You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was trying to upgrade our 1.10 project to 1.11 using the O365 CLI.
I simply used spfx project upgrade.
I got the following exception and the O365 CLI quit after that:
o365$ spfx project upgrade
readline.js:1086
throw err;
^
SyntaxError: Unexpected token in JSON at position 0
at JSON.parse (<anonymous>)
at manifestFiles.map (/usr/local/lib/node_modules/@pnp/office365-cli/dist/o365/spfx/commands/project/base-project-command.js:126:35)
Looking at the source code in this repo I noticed the expected encoding for the [webpart].manifest.json file is UTF-8, but somehow mine was UTF-8 with BOM. I changed the encoding of the file to UTF-8 and it started working after that.
Not sure if you'd call this a bug, but at least it's for those out there that run into the same error I did.
To fix this exception using VS Code:
Open your project in VS Code
Open the manifest.json file
Look for the actual encoding in the bottom of the window (mine says UTF-8 with BOM)
Click it (the encoding)
Choose "Save with Encoding" from the Action menu in the top
Choose "UTF-8"
Re-run spfx project upgrade
Steps to reproduce
To reproduce this, change the encoding of the manifest.json file to UTF-8 with BOM. Then run spfx project upgrade. You should now have the same exception as mentioned above.
Expected result
Either the result should be that the command works fine with different encodings, or it should detect that the encoding is wrong and tell me that I need to change the encoding to UTF-8.
Actual result
The error mentioned above.
Environment
MacOS, running command from bash terminal inside VS Code.
The text was updated successfully, but these errors were encountered:
Hey @waldekmastykarz , I can pick this up 🙂 also sense checking here, we should apply the fix anywhere we read a utf8 encoded file and parse it correct?
Description
I was trying to upgrade our 1.10 project to 1.11 using the O365 CLI.
I simply used
spfx project upgrade
.I got the following exception and the O365 CLI quit after that:
Looking at the source code in this repo I noticed the expected encoding for the [webpart].manifest.json file is UTF-8, but somehow mine was UTF-8 with BOM. I changed the encoding of the file to UTF-8 and it started working after that.
Not sure if you'd call this a bug, but at least it's for those out there that run into the same error I did.
To fix this exception using VS Code:
spfx project upgrade
Steps to reproduce
To reproduce this, change the encoding of the manifest.json file to UTF-8 with BOM. Then run
spfx project upgrade
. You should now have the same exception as mentioned above.Expected result
Either the result should be that the command works fine with different encodings, or it should detect that the encoding is wrong and tell me that I need to change the encoding to UTF-8.
Actual result
The error mentioned above.
Environment
MacOS, running command from bash terminal inside VS Code.
The text was updated successfully, but these errors were encountered: