Hi, I'm new to prismic from Japan,
I'm creating a website using prismic and next.js(App router).
I changed a few things in prismic and published them, but the changes wouldn't appear on my website.
I checked prismic api endpoint and I got error messages.
the error messages are;
- {"message":"Missing Authentication Token"} at https://customtypes.prismic.io , https://your-repo-name.cdn.prismic.io/api/v2/graphql and https://if-api.prismic.io/if/write/your-repo-name--catalog-name.
- {"type":"api_validation_error","message":"Please specify ref"} at https://your-repo-name.cdn.prismic.io/api/v2/documents/search
I have no idea what to do. Could anyone help me?
Thank you in advance.
<My website settings>
- Repository security ( API access ) is;
Public API for Master only - Require an access token to preview future releases. - Permanent access tokens is;
published.
<My code settings>
.env.local
PRISMIC_ACCESS_TOKEN=*****************
prismic.js
export const createClient = ({ config }) => {
const client = prismic.createClient(repositoryName, {
routes,
accessToken: process.env.PRISMIC_ACCESS_TOKEN,
fetchOptions:
process.env.NODE_ENV === 'production'
? { next: { tags: ['prismic'] }, cache: 'force-cache' }
: { next: { revalidate: 5 } },
...config,
});
prismicNext.enableAutoPreviews({ client });
return client;
};
I've already checked this post.