pnp / vscode-viva

With the SharePoint Framework Toolkit extension, you can create and manage your SharePoint Framework solutions on your tenant. All actions you need to perform during the development flow are at your fingertips.
https://marketplace.visualstudio.com/items?itemName=m365pnp.viva-connections-toolkit
MIT License
34 stars 14 forks source link

🐞 [Bug]: Upgrade action issue #60

Closed Saurabh7019 closed 1 year ago

Saurabh7019 commented 1 year ago

πŸ“ Error caused by newline characters in overrides JSON while upgrading SPFx solution using vscode-viva upgrade action

I am using vscode-viva to upgrade an SPFx solution. While updating the .eslintrc.js file as suggested in the upgrade report, I noticed an issue where newline characters ("\n") are being displayed as line breaks in the overrides JSON object. This is corrupting the file and causing the following error during the solution build.

Cannot read config file: C:\RnD\helloWorld\.eslintrc.js
Error: Invalid or unexpected token

πŸ‘£ Steps To Reproduce

Steps to reproduce the behavior:

  1. Open Viva Connection Toolkit extension in a SPFX project (v.1.15.0)
  2. Click on the 'Upgrade' action.
  3. Follow the instruction in the spfx.upgrade.md report.
  4. Notice the line breaks in .eslintrc.js image

πŸ“œ Expected behavior

The value should be displayed without newline characters ("\n") interpreted as line breaks. image

πŸ’» Desktop (please complete the following information):

πŸ€” Additional context

I am certain that it is a cli-microsoft365 issue, but I was unable to reproduce it with CLI v6.9.0. Therefore, logging the issue here.

Adam-it commented 1 year ago

@Saurabh7019 thanks for reporting the issue and sorry for the late reply. I will look into it ASAP πŸ‘

Adam-it commented 1 year ago

yep so I managed to confirm this is CLI for Microsoft 365 related. How to repro this:

  1. download a spfx webpart sample from the pnp gallery that has exact spfx 1.15.0 version. I used the react roomchat https://github.com/pnp/sp-dev-fx-webparts/blob/main/samples/react-roomchat/.yo-rc.json
  2. using CLI run m365 spfx project upgrade --output md > "upgrade-report.md"
  3. when checking the .md report without any md preview just plain text we will see the linebreaks were removed

image

@Saurabh7019 thank you for reporting the issue but unfortunately fixing this is out of scope of this tool. I will open this as a new bug in the CLI repo and start checking it with other maintainers and then I will close this one.

Adam-it commented 1 year ago

I am closing this one since it was moved to CLI for M365 repo https://github.com/pnp/cli-microsoft365/issues/5161