現象
npx prisma studio
すると、Invalid string length
エラーがでるようになった。
non-recoverable error とか言われると、慌てふためく。
エラーメッセージ詳細
Fatal Error
A non-recoverable error has occurred and Studio has to be restarted. Please consider reporting this error to us by opening an issue on GitHub and attaching the error details. If this persists, please clear out your IndexedDB and try again.
Invalid string length
RangeError: Invalid string length
at JSON.stringify ()
at _t.serialize (http://localhost:5555/assets/index.js:1:49091)
at _t.update (http://localhost:5555/assets/index.js:1:12197)
at Cc (http://localhost:5555/assets/vendor.js:50:6994)
at _t.n (http://localhost:5555/assets/vendor.js:50:6688)
at _t.update (http://localhost:5555/assets/index.js:1:48948)
at Cc (http://localhost:5555/assets/vendor.js:50:6994)
at _t.n (http://localhost:5555/assets/vendor.js:50:6688)
at http://localhost:5555/assets/index.js:1:82272
at Array.forEach ()
環境
next: 12.1.6
react: 18.1.0
@prisma/client: 3.14.0
prisma: 3.14.0
解消方法
Invalid string length?何か巨大なデータがうっかり入っちゃったりした?などと、慌てふためくけど、開発環境だとしても、DB のデータを削除してみるのは、やめましょう。DB 悪くない。
ちゃんと、解決方法書いてある。
If this persists, please clear out your IndexedDB and try again.
(それでも解決しない場合は、IndexedDBをクリアし、再度試してみてください)
逆だろ。先にクリア。
IndexedDB is 何?
Browser のキャッシュ的な。Chrome の場合、DevTools を開き、Application > IndexedDB からPrisma Studio を消す。
消したら、リロードして、元通り。
おしまい。