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
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.
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".
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.
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
I added these lines to it:
# install openssl RUN apk update && apk upgrade RUN apk add --no-cache openssl
And, that solved the problem.
The above is the detailed content of Prisma: Could not parse schema engine response. For more information, please follow other related articles on the PHP Chinese website!