我也遇到了这个问题,并且我加上了偏移量 5593 后 node解析还是null ,都是, { source: null, line: null, column: null, name: null } 我的代码报错信息是: TypeError: Cannot read property \'XXXXX\' of null at https://usr/.../app-service.js:4892:28680 at https://usr/.../app-service.js:4892:12480 at https://usr/.../app-service.js:4853:15795 试过了 10485,28680 和 10446,15795 也都还是null
线上小程序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 }
2021-09-24