webdev3
(Web Dev)
November 1, 2023, 5:00am
1
Hello, I'm encountering an error when attempting to run a build process after introducing a new page_type. The issue seems to be resolved when I generate a new access token, but I'm uncertain about the cause. I'm seeking expert assistance to understand and address this problem.
[Link resolver error] Unknown type
Declared type: case_studies
Expected one of:
- sub_menu
- resources_hub_pages
- page
- hubspot_form
- industry_pages
- solution_pages
- grid_layout
- layout
- product_pages
- settings
- orchestration_platform
- aboutus_logos
- customer_logos
- landing_pages
Hi @webdev3 ,
Are you using the App Router? It's possible that this is related to caching issues we've been seeing:
Perhaps it would be helpful, if you could extend the Next.js / Deploy documentation with the most proven deployment methods (in addition to the blog post ).
Especially for those who are new to Prismic and the App Router, it might be difficult to find the best way to deploy the projects.
I now use on-demand revalidation with a webook to /api/revalidate to reflect quick changes, but still trigger a rebuild of the application to rebuild my sitemap (app/sitemap.js) too.
If anyone has a better appr…
In your other thread , I asked if your Route Resolver is up to date. That is typically the cause of this error.
Sam
webdev3
(Web Dev)
November 2, 2023, 7:35am
3
App router only and shared the details of that thread
Hey @webdev3 ,
Is your route resolver up to date with route objects for all of the routes on your website?
Sam
Hi @webdev3 ,
Do you have at least one document published in each document type? An empty type can throw this sort of error, which could also result in previews redirecting to the home page as you described in your other thread.
Sam
webdev3
(Web Dev)
November 7, 2023, 5:59am
5
I have more than one document sam, I've published the document before running build
Hey @webdev3 ,
I'm just checking in to see if you made any progress on this error?
A Link Resolver error is usually because your routes
array includes a type that doesn't exist in your repository.
Sam