之前的相关问题:VS2017与相对路径不兼容,当调试UWP应用时,现在尝试从应用URI加载源Map,而主机不支持它。
'WWAHost.exe' (Script): Loaded 'Script Code (MSAppHost/3.0)'.
SourceMap ms-appx://6b826582-e42b-45b9-b4e6-dd210285d94b/js/require-config.js.map read failed: The URI prefix is not recognized..
在此处硬编码完整路径并不是一个好主意,我希望我们有一个选项可以像2.9.2版本那样工作,以便我们可以获得自动解析的完整路径。
编辑:在TS2.9中可以正常工作的tsconfig.json,但在TS3.0中无法正常工作:
{
"compilerOptions": {
"strict": true,
"noEmitOnError": true,
"removeComments": false,
"sourceMap": true,
"target": "es2017",
"outDir": "js/",
"mapRoot": "js/",
"sourceRoot": "sources/",
"emitBOM": true,
"module": "amd",
"moduleResolution": "node"
},
"exclude": [
"node_modules",
"wwwroot"
]
}
我尝试修复此问题的失败尝试(删除了mapRoot
并更改了sourceRoot
)
{
"compilerOptions": {
"strict": true,
"noEmitOnError": true,
"removeComments": false,
"sourceMap": true,
"target": "es2017",
"outDir": "js/",
"sourceRoot": "../sources/",
"emitBOM": true,
"module": "amd",
"moduleResolution": "node"
},
"exclude": [
"node_modules",
"wwwroot"
]
}
3条答案
按热度按时间niwlg2el1#
在VS论坛上转发了这个帖子,但两周前关闭了。https://developercommunity.visualstudio.com/content/problem/315161/vs2017-1581-cannot-use-source-maps-when-debugging.html
9rygscc12#
你找到解决这个问题的方法了吗?
xnifntxz3#
VS停止支持JS项目,所以没有。