线上小程序sourcemap解析输出的为什么是null?
按照这个文档操作的 https://developers.weixin.qq.com/community/develop/article/doc/0008643aa54ce81d519ad84735b413?page=1#comment-list 确认了版本是对的,写的 node 代码,返回的是 null,还有什么办法吗?Full 和 App 里的 app-service.map.map 都试过了 [图片] [图片] const fs = require("fs");
const { SourceMapConsumer } = require("source-map");
async function originalPositionFor(line, column) {
const sourceMapFilePath = "./sourcemap/__APP__/app-service.map.map";
const sourceMapConsumer = await new SourceMapConsumer(
JSON.parse(fs.readFileSync(sourceMapFilePath, "utf8"))
);
return sourceMapConsumer.originalPositionFor({
line,
column,
});
}
originalPositionFor(16879, 11266).then((res) => {
console.log(res);
});
➜ sourcemap node index.js { source: null, line: null, column: null, name: null }