baidu / san

A fast, portable, flexible JavaScript component framework
https://baidu.github.io/san/
MIT License
4.73k stars 551 forks source link

san-ssr 可以支持sourcemap吗? #731

Open leviscar opened 2 years ago

leviscar commented 2 years ago

FATAL: 2022-09-27 15:04:10 pid[5342] logId[537247443] TemplateJsRenderError:Error: compversion:1.1.637 jsVersion: error:TypeError: Cannot convert undefined or null to object stack:TypeError: Cannot convert undefined or null to object at Function.entries () at Object.iterate (/home/work/nodejs/node_modules/san-ssr/dist/runtime/underscore.js:114:50) at eval (eval at createRenderer (/home/work/nodejs/node_modules/san-ssr/dist/target-js/index.js:82:61), :45:30) at childSlots10. (eval at createRenderer (/home/work/nodejs/node_modules/san-ssr/dist/target-js/index.js:82:61), :112:118) at eval (eval at createRenderer (/home/work/nodejs/node_modules/san-ssr/dist/target-js/index.js:82:61), :44:13) at childSlots7. (eval at createRenderer (/home/work/nodejs/node_modules/san-ssr/dist/target-js/index.js:82:61), :117:111) at eval (eval at createRenderer (/home/work/nodejs/node_modules/san-ssr/dist/target-js/index.js:82:61), :63:13) at childSlots4. (eval at createRenderer (/home/work/nodejs/node_modules/san-ssr/dist/target-js/index.js:82:61), :134:106) at eval (eval at createRenderer (/home/work/nodejs/node_modules/san-ssr/dist/target-js/index.js:82:61), :62:13) at childSlots3. (eval at createRenderer (/home/work/nodejs/node_modules/san-ssr/dist/target-js/index.js:82:61), :154:98)

调用 compileToSource的方法,render出来以后,无法定位到出错的代码实际执行的代码片段

期望是可以支持成下面这种方式: FATAL: 2022-09-27 15:04:10 pid[5342] logId[537247443] TemplateJsRenderError:Error: compversion:1.1.637 jsVersion: error:TypeError: Cannot convert undefined or null to object stack:TypeError: Cannot convert undefined or null to object at src/components/ItemList.san (26:13)

参考vue ssr的sourcemap