# Getting error on build

**URL:** <https://community.prismic.io/t/getting-error-on-build/14423>\
**Category:** Developing with Prismic\
**Tags:** nextjs\
**Created:** [November 1, 2023, 5:00am UTC](https://community.prismic.io/t/getting-error-on-build/14423 "2023-11-01T05:00:35Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![webdev3](https://avatars.discourse-cdn.com/v4/letter/w/ee7513/32.png) [@webdev3](https://community.prismic.io/u/webdev3)\
**Post date:** [November 1, 2023, 5:00am UTC](https://community.prismic.io/t/getting-error-on-build/14423/1 "2023-11-01T05:00:35Z")

</div>

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.

```auto
 [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

```

---

<div class="post-metadata">

**Author:** ![samlittlefair](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/samlittlefair/32/696_2.png) [@samlittlefair](https://community.prismic.io/u/samlittlefair)\
**Post date:** [November 1, 2023, 9:30am UTC](https://community.prismic.io/t/getting-error-on-build/14423/2 "2023-11-01T09:30:23Z")

</div>

Hi @webdev3,

Are you using the App Router? It's possible that this is related to caching issues we've been seeing:

> [@Caching issue with Next.js App Router - Vercel Deployment](https://community.prismic.io/t/caching-issue-with-next-js-app-router-vercel-deployment/13834/16):
>
> Perhaps it would be helpful, if you could extend the [Next.js / Deploy](https://prismic.io/docs/deploy-nextjs) documentation with the most proven deployment methods (in addition to the [blog post](https://prismic.io/blog/how-to-use-prismic-with-nextjs-app-router)). 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](https://community.prismic.io/t/prismic-preview-always-opening-the-home-page/14422), I asked if your Route Resolver is up to date. That is typically the cause of this error.

Sam

---

<div class="post-metadata">

**Author:** ![webdev3](https://avatars.discourse-cdn.com/v4/letter/w/ee7513/32.png) [@webdev3](https://community.prismic.io/u/webdev3)\
**Post date:** [November 2, 2023, 7:35am UTC](https://community.prismic.io/t/getting-error-on-build/14423/3 "2023-11-02T07:35:28Z")

</div>

App router only and shared the details of that thread

> [@Prismic Preview always opening the home page](https://community.prismic.io/t/prismic-preview-always-opening-the-home-page/14422/2):
>
> Hey @webdev3, Is your route resolver up to date with route objects for all of the routes on your website? Sam

---

<div class="post-metadata">

**Author:** ![samlittlefair](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/samlittlefair/32/696_2.png) [@samlittlefair](https://community.prismic.io/u/samlittlefair)\
**Post date:** [November 6, 2023, 1:45pm UTC](https://community.prismic.io/t/getting-error-on-build/14423/4 "2023-11-06T13:45:39Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![webdev3](https://avatars.discourse-cdn.com/v4/letter/w/ee7513/32.png) [@webdev3](https://community.prismic.io/u/webdev3)\
**Post date:** [November 7, 2023, 5:59am UTC](https://community.prismic.io/t/getting-error-on-build/14423/5 "2023-11-07T05:59:32Z")

</div>

I have more than one document sam, I've published the document before running build

---

<div class="post-metadata">

**Author:** ![samlittlefair](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/samlittlefair/32/696_2.png) [@samlittlefair](https://community.prismic.io/u/samlittlefair)\
**Post date:** [November 24, 2023, 4:26pm UTC](https://community.prismic.io/t/getting-error-on-build/14423/7 "2023-11-24T16:26:07Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![delvinshoko](https://avatars.discourse-cdn.com/v4/letter/d/c5a1d2/32.png) [@delvinshoko](https://community.prismic.io/u/delvinshoko)\
**Post date:** [May 10, 2024, 9:41am UTC](https://community.prismic.io/t/getting-error-on-build/14423/9 "2024-05-10T09:41:22Z")

</div>

Hie, i am kind of new to prismic, i recently did a project with nextjs 14 and prismic, i have successfully deployed the app on vercel but i recently acquired a custom domain and was hoping to use GitHub pages instead but when trying to deploy the same project with github actions i am getting these errors. The same code builds with no errors on my local host as well as on vercel but fails with the highlighted errors on GitHub when i try to use github actions.

````Error

Error: Page with `dynamic = "error"` couldn't be rendered statically because it used `request.url`.``` 

Export encountered errors on following paths:
	/api/exit-preview/route: /api/exit-preview
	/api/preview/route: /api/preview
Error: Process completed with exit code 1.

/**Here is my nextjs.config.mjs */

/** @type {import('next').NextConfig} */
const nextConfig = {};

export default nextConfig;
````

---

<div class="post-metadata">

**Author:** ![samlittlefair](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/samlittlefair/32/696_2.png) [@samlittlefair](https://community.prismic.io/u/samlittlefair)\
**Post date:** [May 23, 2024, 1:37pm UTC](https://community.prismic.io/t/getting-error-on-build/14423/11 "2024-05-23T13:37:48Z")

</div>

Hey @delvinshoko,

As far as I understand, GitHub pages only allows static HTML or client-rendered websites. With GitHub, you can't have any server functions. The paths listed in the error message both run logic on the server, and so they wouldn't work on GitHub pages. If you delete those files, it might work, but you won't be able to use Prismic previews.

Sam
