3

I have an aurelia application updated to the latest beta, 1.0.0-beta.1.2.1 at the time of this writing. This version of aurelia already uses Babel 6, and my application is based on the based on the ASP.NET 5 ES2016 navigation skeleton.

"All of a sudden", whenever I try to open my untranspiled javascript source files in Chrome (Version 49.0.2623.110 m (64-bit)) Developer tools, for instance main.js, all I get to see is the html of Index.cshtml.
It doesn't matter which javascript file I try to open, it always shows the html of Index.cshtml instead of javascript.

The transpiled files are displayed correctly in Chrome Dev Tools.

I've had this before but it usually meant I had a binding or templating error somewhere, but in this case the application works perfectly, so it probably has to do with the sourcemaps... Or does it?

My questions are:

  1. What is the best way to track down a subtle binding or templating error in Aurelia? Everything I've tried to do in my applcation works fine, but I don't want to rule out this being my own fault just yet.

  2. In case it's not my fault, has anybody come across this before? What is the reason the sourcemaps are not working; is it Aurelia? is it Babel 6? Is it Chrome?

Update

It doesn't seem to be a Chrome issue; the same problem occurs in Edge.

Update 2

By turning off Enable javascript sourcemaps on Chrome Developer Tools I can debug de transpiled code. The transpilation gulp tasks I'm using are copy/pasted from the version mentioned above.

Has anybody else come across this issue?

4

1 回答 1

1

好的,我想我找到了问题所在。

我在 中定义的gulp 任务中更改includeContenttruefor ,因此该文件的第 23 行如下所示:sourcemaps.writebuild-systembuild\tasks\build.js

.pipe(sourcemaps.write({ includeContent: true}))

这是 false在导航框架中设置的,所以更多的人应该有同样的问题。无论如何,这似乎已经解决了这个问题。

我还删除了该调用中的参数,因为它仅在issourceRoot: "/src"时才需要。includeContentfalse

于 2016-04-11T11:57:51.530 回答