问题描述
cool unix框架内部在新的hbuilderx中的一个报错:
解决方案:
原来的代码的1296行里面的代码改成加一个try
try {
const d = JSON.parse(code);
// 转字符串,不然会报错:Method too large
if (id.includes("/locales/")) {
let t = [];
d.forEach(([a, b]) => {
t.push(`${a}<__=__>${b}`);
});
code = JSON.stringify([[t.join("<__&__>")]]);
}
else {
code = JSON.stringify(d);
}
}
catch (e) {
// code 已被其他插件转换为非 JSON 格式(如 UTS 模块代码),跳过处理
}