Typescript 1.0地图文件无法加载 [英] Typescript 1.0 map files do not load

查看:155
本文介绍了Typescript 1.0地图文件无法加载的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在VS2013更新2 RC(Typescript 1.0 RTM)中,我无法在其中一个项目中调试TypeScript文件.我将其追溯到地图文件声明.默认情况下,我的JS文件包含:

In VS2013 update 2 RC (Typescript 1.0 RTM) I cannot debug TypeScript files in one of my projects. I have traced this back to the map file declaration. By default my JS file contains:

//# sourceMappingURL=general.js.map

应该正确的是,映射文件与TS和JS文件位于同一文件夹中.但是,它不起作用.如果我手动编辑文件,并指定完整路径,它将起作用:

Which should be correct, the map file is in the same folder as the TS and JS files. However it doesn't work. if I manually edit the file, specifying the full path, it works:

//# sourceMappingURL=C:/Users/myname/Documents/Visual Studio 2013/Projects/Test/JSLib/general.js.map

这使我感到困惑,因为肯定浏览器不应该理解完整路径,例如在IISExpress网站之外?

This confuses me, because surely the browser shouldn't understand the full path, eg outside the IISExpress web site?

有人可以建议一种方法来使地图文件与第一个地图一起使用吗?谢谢

Can anyone suggest a way to get map files working with the first mapping? Thanks

Windows 8.1 x64,IE11

Windows 8.1 x64, IE11

更新:通过IISExpress运行的应用程序使用Windows身份验证.如果我关闭地图文件加载!另外,检查输出窗口,我看到:

Update: the app, running through IISExpress, uses Windows authentication. if I turn this off the map files load! Also, checking the output window I see:

SourceMap http://localhost:53524/JSLib/general.js.map read failed: The remote server returned an error: (401) Unauthorized.'iexplore.exe' (Script): Loaded 'http://localhost:53524/JSLib/'.

我的IIS Express日志包含

My IIS Express logs contain

2014-04-12 13:58:24 ::1 GET /JSLib/general.js.map - 53524 - ::1 - - 401 2 5 0

但是我可以在IE中浏览至http://localhost:53524/JSLib/general.js.map.那么,对地图文件(VS?)进行调用的原因是什么,以及如何使用它来使用我的凭据?

But I can browse to http://localhost:53524/JSLib/general.js.map fine in IE. So what's making the call for the map file (VS?) and how to I get it to use my credentials?

推荐答案

我也一直遇到此问题.很遗憾地说,我不知道问题的根源是什么.但是,我找到了一种解决方法.

I too have been experiencing this problem. I am sorry to say that I do not know what the root of the problem is. However, I have found a workaround.

打开项目属性,然后转到"TypeScript Build"选项卡.在调试"部分中,选中指定源地图的根目录"选项,然后输入值$(ProjectDir)\Scripts.

Open your project properties and go to the 'TypeScript Build' tab. In the 'Debugging' section, check the 'Specify root directory of the source maps' option and enter the value $(ProjectDir)\Scripts.

这可以在启用Windows身份验证和默认'sourceMappingUrl'的情况下使用.

This works with Windows Authentication enabled and with the default 'sourceMappingUrl'.

这篇关于Typescript 1.0地图文件无法加载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆