cli-microsoft365 icon indicating copy to clipboard operation
cli-microsoft365 copied to clipboard

m365 spfx project upgrade Error: SyntaxError: Unexpected token } in JSON at position 852

Open cryongen opened this issue 2 years ago • 7 comments

Description

I'm trying to run spfx project upgrade, but i'm getting an error Error: SyntaxError: Unexpected token } in JSON at position 852

Using: NVM for windows Node 10.13.0 NPM 6.4.1

Steps to reproduce

  1. Open the project folder on powershell
  2. Type m365 spfx project upgrade --output md > "upgrade-report.md"

Expected results

The upgrade steps genereated by de m365 cli

Actual results

Error: SyntaxError: Unexpected token } in JSON at position 852

Diagnostics

Executing command spfx project upgrade with options {"options":{"debug":true,"output":"md"}} Collecting project... Error: SyntaxError: Unexpected token } in JSON at position 852

CLI for Microsoft 365 version

5.3.0

nodejs version

10.13.0

Operating system (environment)

Windows

Shell

Windows PowerShell

cli doctor

{ "os": { "platform": "win32", "version": "Windows 10 Enterprise", "release": "10.0.19044" }, "cliVersion": "5.3.0", "nodeVersion": "v14.19.3", "cliAadAppId": "31359c7f-bd7e-475c-86db-fdb8c937548e", "cliAadAppTenant": "common", "authMode": "DeviceCode", "cliEnvironment": "", "cliConfig": {}, "roles": [], "scopes": [ "AllSites.FullControl", "AppCatalog.ReadWrite.All", "ChannelMember.ReadWrite.All", "ChannelMessage.Read.All", "ChannelMessage.Send", "ChannelSettings.ReadWrite.All", "Chat.Read", "Chat.ReadWrite", "Directory.AccessAsUser.All", "Directory.ReadWrite.All", "Group.ReadWrite.All", "IdentityProvider.ReadWrite.All", "Mail.ReadWrite", "Mail.Send", "Place.Read.All", "Policy.Read.All", "ServiceHealth.Read.All", "ServiceMessage.Read.All", "ServiceMessageViewpoint.Write", "Tasks.ReadWrite", "Team.Create", "TeamMember.ReadWrite.All", "TeamsApp.ReadWrite.All", "TeamsAppInstallation.ReadWriteForUser", "TeamSettings.ReadWrite.All", "TeamsTab.ReadWrite.All", "TermStore.ReadWrite.All", "User.Invite.All", "User.ReadWrite.All", "profile", "openid", "email" ] }

Additional Info

No response

cryongen avatar Jun 17 '22 19:06 cryongen

Description

I'm trying to run spfx project upgrade, but i'm getting an error Error: SyntaxError: Unexpected token } in JSON at position 852

Using: NVM for windows Node 10.13.0 NPM 6.4.1

Steps to reproduce

  1. Open the project folder on powershell
  2. Type m365 spfx project upgrade --output md > "upgrade-report.md"

Expected results

The upgrade steps genereated by de m365 cli

Actual results

Error: SyntaxError: Unexpected token } in JSON at position 852

Diagnostics

Executing command spfx project upgrade with options {"options":{"debug":true,"output":"md"}} Collecting project... Error: SyntaxError: Unexpected token } in JSON at position 852

CLI for Microsoft 365 version

5.3.0

nodejs version

10.13.0

Operating system (environment)

Windows

Shell

Windows PowerShell

cli doctor

{ "os": { "platform": "win32", "version": "Windows 10 Enterprise", "release": "10.0.19044" }, "cliVersion": "5.3.0", "nodeVersion": "v14.19.3", "cliAadAppId": "31359c7f-bd7e-475c-86db-fdb8c937548e", "cliAadAppTenant": "common", "authMode": "DeviceCode", "cliEnvironment": "", "cliConfig": {}, "roles": [], "scopes": [ "AllSites.FullControl", "AppCatalog.ReadWrite.All", "ChannelMember.ReadWrite.All", "ChannelMessage.Read.All", "ChannelMessage.Send", "ChannelSettings.ReadWrite.All", "Chat.Read", "Chat.ReadWrite", "Directory.AccessAsUser.All", "Directory.ReadWrite.All", "Group.ReadWrite.All", "IdentityProvider.ReadWrite.All", "Mail.ReadWrite", "Mail.Send", "Place.Read.All", "Policy.Read.All", "ServiceHealth.Read.All", "ServiceMessage.Read.All", "ServiceMessageViewpoint.Write", "Tasks.ReadWrite", "Team.Create", "TeamMember.ReadWrite.All", "TeamsApp.ReadWrite.All", "TeamsAppInstallation.ReadWriteForUser", "TeamSettings.ReadWrite.All", "TeamsTab.ReadWrite.All", "TermStore.ReadWrite.All", "User.Invite.All", "User.ReadWrite.All", "profile", "openid", "email" ] }

Additional Info

No response

** Installed NODE 14 to run cli doctor

cryongen avatar Jun 17 '22 20:06 cryongen

Hi @cryongen, thanks for reaching out! Let's see if we can narrow this down to help you out.

what kind of SPFx version are you to trying to upgrade?

do you experience the same if you choose another output type, say --output text?

martinlingstuyl avatar Jun 17 '22 22:06 martinlingstuyl

Adding to what @martinlingstuyl said, would it be possible for you to share the project that you're trying to upgrade with us so that we can reproduce the issue that you're seeing? Otherwise, please let us know which version of the SPFx project you're trying to upgrade, what components it has (web parts, extensions, ACEs, etc.) and to what version you're upgrading. We appreciate your help.

waldekmastykarz avatar Jun 18 '22 13:06 waldekmastykarz

Hi @cryongen, thanks for reaching out! Let's see if we can narrow this down to help you out.

what kind of SPFx version are you to trying to upgrade?

do you experience the same if you choose another output type, say --output text?

the project is SPFX 1.8.1, tried to upgrade to spfx 1.10.0 and 1.14

Tried the output text and get same error

cryongen avatar Jun 20 '22 11:06 cryongen

Adding to what @martinlingstuyl said, would it be possible for you to share the project that you're trying to upgrade with us so that we can reproduce the issue that you're seeing? Otherwise, please let us know which version of the SPFx project you're trying to upgrade, what components it has (web parts, extensions, ACEs, etc.) and to what version you're upgrading. We appreciate your help.

The project is on webparts, it have about 30 web parts in the project,

I tried to upgrade from spfx 1.8.1 to gratear versions, triead 1.10.0 , 1.14, etc. all of these i'm geteting the same error

cryongen avatar Jun 20 '22 11:06 cryongen

Already tried a clean install of node 1.10 and 1.14, and the m365 package, and still get the same error.

cryongen avatar Jun 20 '22 12:06 cryongen

Thank you for the additional information @cryongen. Would it be possible for you to share the project with us so that we can reproduce what you're seeing?

waldekmastykarz avatar Jun 20 '22 14:06 waldekmastykarz

@cryongen, is this still an issue for you, or can we close it?

martinlingstuyl avatar Aug 28 '22 19:08 martinlingstuyl

@cryongen, is this still an issue for you, or can we close it?

HI martin, i forgot to answer here.

You can close this thread. There a misconfiguration on my project. tried on another projects and works fine.

Tks

cryongen avatar Aug 29 '22 12:08 cryongen

Just an FYI, I had this issue today trying to upgrade a project to 1.15.2

The problem turned out to be a dangling comma in the properties section of a webpart manifest file, removing the comma solved the problem...

Screenshot 2022-09-05 at 13 31 20

phillipharding avatar Sep 05 '22 12:09 phillipharding

Thanks for mentioning it @phillipharding! That's super helpful for other people running into this

martinlingstuyl avatar Sep 05 '22 14:09 martinlingstuyl