Builds suddenly failing with 500 errors

Hi, our builds are suddenly failing with 500 errors. I've been trying to track down the cause but it seems nothing has changed in our codebase recently.

I looked through the prismic documentation and I can't find a reference to endpoints anymore, but changing it to within our sm.json doesn't seem to stop it being called, which makes me wonder whether we have an outdated package that is making this call.

I've removed the public key from the call below. If you need it I can send it to you privately.


Error: Error: Unexpected status code [500] on URL

Hi @daveymoores,

Thanks for reaching out.

Actually, the CDN is necessary in all cases and shouldn't cause an issue, but can you please tell us how often you get this error and what is the technology/framework used.

Also, I would like to confirm; is pila is the repository name you are using and having errors related to? If not, can you please send us the repository name (in a private message if necessary) to check if we have any errors on our side?

Hi Fares,

Yep, pila is the repository name and It's a Next.js project. I just triggered a build and I'm getting the same error.

I've sent through the full error on a private message.

Thanks for your help.

1 Like

Ok, @daveymoores,

Thanks for the info, I haven't got the private message can you send it again to me

I will check tomorrow and let you know.

I've looked at the logs related to your repository, and there seem no recent errors happening, and it seems that those errors are on your end.

Are you using a proxy in your network?

Also, if you can share with us a zip file with your project code (in a private message if necessary) to try to reproduce the issue on our end, it will be really helpful.

I've messaged Fares directly with some new findings but I see he is on holiday.

Is anyone else able to help me and pick this up?

Thanks, D

Hello @daveymoores

Fares is out of the office the whole of this week. So far, I found that you have some issues in routes learning_module and assessment_application. I am trying to debug it more and return it to you as I find something.

I have one question for you:
Are you able to run your project locally because I get an error when I run locally?

And on console it shows: at Function.PilaApp.getInitialProps (webpack-internal:///./pages/_app.tsx:218:11)


Hi Priyanka,

Sorry I was away for a few days.

Yes that is the error I'm facing. When the project builds it fetches a bunch of data for all the routes in _app.tsx. It's there i'm getting the 500 error you have shown above. I sent Fares some of findings. Are you able to access his direct messages?


Hello, @daveymoores/ We have received your message. Fares will review the information as soon as possible. Thank you

Great, thanks @Pau

1 Like

You're welcome.

Hi Pau,

Any developments on this?


Hi @daveymoores,
I was off for a few days, I'm currently building your project locally and trying to reproduce the issue on my side to be able to debug the issue, and I will let you know about my finding as soon as possible.

Thanks Fares.

Hi @daveymoores,

I'm still investigating this; this error usually means that you have written the resolver incorrectly or have documents in that list without the content relationship selected (I've checked your repo, and it doesn't seem to be the case).

I will let you know as soon as we have any updates.

Hi @daveymoores,

I've got some updates about this issue from our dev team, and we think that this is the cause of the problem:

module.parent links to learning_module_home which appears to be a singleton without UID:[…]ny(document.type,%20%5B%22learning_module_home%22%5D)%5D%5D

and here are some potential solutions:

  • Adding a UID field to learning_module_home with a value of "learning-modules"

I've tested that and it works see the following screenshot:

  • Or updating your route resolver rules for assessment_application document type to:

{ type: "assessment_application", path: "/learning-modules/:module/:uid", resolvers: { module: "module", }, }

Please let us know if you need any further assistance,

Thanks Fares,

I’m on holiday but will see if someone else from the team can give this a go, otherwise I’ll make these changes on Monday and update this thread.


1 Like

Thanks Fares, our builds are now passing. It's strange how this randomly started failing without any code changes :man_shrugging: but at least it's all working correctly :tada:

1 Like