打字稿:TSX文件在Chrome中显示为空白 [英] Typescript: TSX files show up blank in Chrome

查看:130
本文介绍了打字稿:TSX文件在Chrome中显示为空白的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试在Google Chrome浏览器中调试TypeScript应用程序时,*.ts文件在检查器中已正确映射到源,但是* .tsx文件显得完全为空,这并没有真正帮助我调试它们.

When attempting to debug a TypeScript application in Google Chrome, the *.ts files are source mapped properly in the inspectors, but the *.tsx files appear totally empty, which doesn't really help me debug them.

如何获取* .tsx文件以正确地映射到源地图?

How can I get *.tsx files to source map correctly?

推荐答案

我建议您尝试为二手Web服务器的* .tsx文件添加MIME类型.

I would suggest you to try add MIME type for *.tsx files for used web server.

如果您的项目托管在IIS上,请尝试将其添加到web.config:

In case your project is hosted on IIS try to add this to your web.config:

<system.webServer>
  ...
  <staticContent>
    <remove fileExtension=".tsx" />
    <mimeMap fileExtension=".tsx" mimeType="application/javascript" />
  </staticContent>
</system.webServer>

这篇关于打字稿:TSX文件在Chrome中显示为空白的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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