Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add public Git error messages #1283

Merged
merged 20 commits into from
Feb 6, 2024
Merged
Show file tree
Hide file tree
Changes from 19 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions messages/git-error.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Git: Error

An error occured while syncing models to Prismic from a Git repository.
angeloashmore marked this conversation as resolved.
Show resolved Hide resolved

### How to fix the issue

Syncing the project again by committing to the repository.
angeloashmore marked this conversation as resolved.
Show resolved Hide resolved

If the issue is not resolved, please check the [Prismic Help Center](https://prismic.io/docs/help-center).
26 changes: 26 additions & 0 deletions messages/git-invalid-slice-machine-config.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Git: Invalid Slice Machine config

The Git repository's Slice Machine configuration file (`slicemachine.config.json`) was not valid.

Any of the following issues could cause this error:

- Missing required properties, such as `repositoryName` and `adapter`.
- Invalid values given to configuration properties.
- Invalid JSON with incorrect syntax
angeloashmore marked this conversation as resolved.
Show resolved Hide resolved

## How to fix the issue

Update the project's Slice Machine configuration file, fixing any syntax errors or incorrect properties.

A basic Slice Machine configuration file looks like this:

```json
// slicemachine.config.json

{
"repositoryName": "example-prismic-repo",
"adapter": "@slicemachine/adapter-next",
"libraries": ["./src/slices"],
"localSliceSimulatorURL": "http://localhost:3000/slice-simulator"
}
```
12 changes: 12 additions & 0 deletions messages/git-unauthorized-github.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Git: Unauthorized Github access
angeloashmore marked this conversation as resolved.
Show resolved Hide resolved

The GitHub app tried to make a request to GitHub, but failed due to unauthorized access.

This error can occur when your GitHub access token expires. Note that GitHub access tokens are managed for you by installing the Prismic GitHub app and is not something you need to manage manually.

## How to fix the issue

If the error occurs continuously, try the following steps:

1. On GitHub, uninstall the Prismic GitHub app.
2. In Slice Machine, navigate to the Settings page and re-install the Prismic GitHub app.
15 changes: 15 additions & 0 deletions messages/git-unauthorized-prismic.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Git: Unauthorzed Prismic access
angeloashmore marked this conversation as resolved.
Show resolved Hide resolved

The GitHub app tried to make a request to Prismic, but failed due to unauthorized access.

This error can occur when syncing model changes to Prismic from GitHub with an invalid Prismic Write API token.

## How to fix the issue

First, ensure a Prismic Write API token was saved in Slice Machine. You can set, update, and delete a Write API token from Slice Machine's Settings page.
bapmrl marked this conversation as resolved.
Show resolved Hide resolved

If a token was already saved in Slice Machine, verify that the Prismic Write API token is valid:

1. In the Prismic repository, navigate to the Settings page.
2. Select **API & Security** in the sidebar and the **Write APIs** tab at the top of the page.
3. Verify that the Write API token is listed. If necessary, generate a new token and save it in Slice Machine.
30 changes: 30 additions & 0 deletions messages/git-unsupported-adapter.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Git: Unsupported adapter

The Slice Machine project uses an adapter that is not supported in the GitHub app.

The following adapters are supported:

- [`@slicemachine/adapter-next`](https://github.com/prismicio/slice-machine/tree/main/packages/adapter-next#readme): Next.js projects
bapmrl marked this conversation as resolved.
Show resolved Hide resolved
- [`@slicemachine/adapter-nuxt`](https://github.com/prismicio/slice-machine/tree/main/packages/adapter-nuxt#readme): Nuxt projects
- [`@slicemachine/adapter-sveltekit`](https://github.com/prismicio/slice-machine/tree/main/packages/adapter-sveltekit#readme): SvelteKit projects

### How to fix the issue

Use a supported adapter.

You can verify which adapter your project uses by checking the `adapter` property in your project's `slicemachine.config.json`.

A basic Slice Machine configuration file looks like this:

```json
// slicemachine.config.json

{
"repositoryName": "example-prismic-repo",
"adapter": "@slicemachine/adapter-next",
"libraries": ["./src/slices"],
"localSliceSimulatorURL": "http://localhost:3000/slice-simulator"
}
```

If you would like us to support your adapter, please [open a feature request](https://github.com/prismicio/slice-machine/issues/new/choose).
Loading