avitorio / outstatic

Outstatic - A static CMS for Next.js
https://Outstatic.com
MIT License
2.67k stars 157 forks source link

Add an explicit error message when the outstatic target branch does not exist #17

Closed qlereboursBS closed 1 year ago

qlereboursBS commented 1 year ago

I tried to create my first collection, and nothing happened (loading forever). After opening the console, I found this message: error: "Variable $input of type CreateCommitOnBranchInput! was provided invalid value for expectedHeadOid (Expected value to not be null)"

Finally, when going to the network, I discovered that the commit was being created on a main branch, that didn't exist on my brand new repository.

It would improve user experience if there was an detailed error message to explain that it's impossible to commit on the repository because the branch is not found.

Would it be possible? Thanks

avitorio commented 1 year ago

@qlereboursBS Thanks for flagging. I'll take a look at it.

avitorio commented 1 year ago

Hey @qlereboursBS, I just wanted to let you know the latest version of Outstatic v0.0.30-rc introduces a OST_REPO_BRANCH environment variable that lets you specify the branch you want.

As for the error message, we are going to work on it soon. I'll leave this issue open as a reminder until we get it done. Thanks!

avitorio commented 1 year ago

@qlereboursBS the error message when a collection can't be created is already merged and will be available in our next version.