0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

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

Posted at

表題のエラーがいきなり発生

ECRにpushする為にNEXT.jsのプロジェクトをbuildしようとしたらいきなり表題のエラーが発生。
いやいや数日前まで普通にできてたよ!

なんか一行追加したら治った!

# ベースイメージの設定
FROM --platform=linux/amd64 node:18-alpine AS base

# 作業ディレクトリの設定
WORKDIR /web

# package.jsonとyarn.lockをコピー
COPY package.json ./

# ~~ 省略 ~~

# アプリケーションを起動
CMD ["npm", "start"]

# ベースイメージの設定
FROM --platform=linux/amd64 node:18-alpine AS base
# 以下を追加
RUN apk add --no-cache openssl

# 作業ディレクトリの設定
WORKDIR /web

# package.jsonとyarn.lockをコピー
COPY package.json ./

# ~~ 省略 ~~

# アプリケーションを起動
CMD ["npm", "start"]

エラーの前に出てた警告

prisma:warn Prisma failed to detect the libssl/openssl version to use, and may not work as expected. Defaulting to "openssl-1.1.x".
19.19 Please manually install OpenSSL and try installing Prisma again.
20.67 prisma:warn Prisma failed to detect the libssl/openssl version to use, and may not work as expected. Defaulting to "openssl-1.1.x".
20.67 Please manually install OpenSSL and try installing Prisma again.
20.68 Environment variables loaded from .env
20.68 Prisma schema loaded from prisma/schema.prisma

openssl をインストールすることで、SSL/TLS 関連の問題が解決された可能性が高いです。コンテナ内で暗号化通信を行うために必須のライブラリであるため、これを追加することで安全な接続を確立し、エラーを回避できるようになったと思われます。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?