ERROR: Unexpected token A in JSON at position 0

What I’m trying to do:
I keep getting this error whenever I try to merge a branch into master.

image

Does anyone knows how to solve this?

Hi @vpbarbosa ! Welcome to the Forum!

Let me ask you something, does your branch have any underscores “_” in the name? What is the name of your branches?

This error usually happens when the name of the branch has a character not supported by the anvil IDE.

If this is not the problem, try doing any other edit in one or both the branches and THEN try again the merge.

1 Like

was this resolved? I have the same issue going on.my branches are dev and master. I get the same error when I try to merge the two. I followed gabriel’s suggested and made an edit in edit and tried and got the error. so I made an edit in master and it failed.
I have a review with my client tomorrow and I need to send a link prior to the call so they can take a look.

1 Like

I have no answer, but I would try to clone to pc, merge and push, and see if it works.
If it doesn’t i would try to create temporary branches in the past commits and merge those, looking for the point in time where it stopped working.

2 Likes

This is probably the best answer if you have urgency to get this fixed.
Maybe the best thing you could do is to create a clone (in anvil) of your app first, then do git clone on your PC to merge and push the changes. The bug is probably only in the IDE for commiting/merging and if you do it manually you won’t have issues (I’m guessing).

Then you can go on with your life AND have a clone with the issue so that the Anvil Staff can take a look into it later.

1 Like

Thanks guys that worked. I had to go into the classic editor to get it to work. Thanks again!

1 Like

Hi @gabriel.duro.s

Actually none of my branches have underscores in the name, they do, however, have hyphen “-”. My branches are “master” and “Hierarchy-Tree”.

I tried to edit both branches but it didn’t work.