AI Translation
This post is translated from Chinese into English through AI.View Original
Recently encountered a strange error of "invalid byte sequence for encoding" that occurs in a Node.js production environment, occasionally in the testing environment, and cannot be reproduced locally. Spent two weeks searching for the cause, first debugging the database back and forth, then going through a round of switching third-party libraries, as well as various code logic refactoring, all to no avail. Today, had a sudden inspiration and changing from node 22 to node 20 fixed the issue.