DEV Community

Cover image for Prisma: Could not parse schema engine response
Akbar Ali
Akbar Ali

Posted on

Prisma: Could not parse schema engine response

Problem

Recently encountered this error while deploying our app to production:

Error: Could not parse schema engine response: SyntaxError: Unexpected token E in JSON at position 0
Enter fullscreen mode Exit fullscreen mode

There is no more explanation why this occurred, just this line. In the recent merge commit we had only changed a couple of locale keywords, that's it.

Figuring out

Searched all over the internet and found nothing.

Then, I noticed a warning a couple lines of above the error, like this:

prisma:warn Prisma failed to detect the libssl/openssl version to use, and may not work as expected. Defaulting to "openssl-1.1.x".
Enter fullscreen mode Exit fullscreen mode

I searched about this on GitHub and found this:
Prisma fails to find openssl 3.0.x on new bookworm

I realised that for some reasons, the new version of the alpine docker image I was using doesn't come with the openssl package - Which was required for Prisma engine.

Solution

The issue discussion I shared above said that use node version 18.5.something and we can temporarily resolve this or use a different docker image.

But, I don't have to use a different version of node and make conflicts to other packages.

So, I should install the package manually.

This is the docker image I was using:

FROM node:18-alpine
Enter fullscreen mode Exit fullscreen mode

I added these lines to it:

# install openssl
RUN apk update && apk upgrade
RUN apk add --no-cache openssl
Enter fullscreen mode Exit fullscreen mode

And, that solved the problem.

Top comments (0)