Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remapping html reports #1

Closed
adrigzr opened this issue Sep 7, 2015 · 5 comments
Closed

Remapping html reports #1

adrigzr opened this issue Sep 7, 2015 · 5 comments

Comments

@adrigzr
Copy link

adrigzr commented Sep 7, 2015

Hi,

Great module! I'm getting the following exception when 'reports' is configured to 'html' in the remapping task.

/project/node_modules/remap-istanbul/node_modules/istanbul/lib/report/html.js:203
                endCol = structuredText[startLine].text.originalLength();
                                                  ^
TypeError: Cannot read property 'text' of undefined
    at /project/node_modules/remap-istanbul/node_modules/istanbul/lib/report/html.js:203:51
    at Array.forEach (native)
    at annotateStatements (/project/node_modules/remap-istanbul/node_modules/istanbul/lib/report/html.js:188:33)
    at HtmlReport.Report.mix.writeDetailPage (/project/node_modules/remap-istanbul/node_modules/istanbul/lib/report/html.js:423:9)
    at /project/node_modules/remap-istanbul/node_modules/istanbul/lib/report/html.js:484:26
    at SyncFileWriter.extend.writeFile (/project/node_modules/remap-istanbul/node_modules/istanbul/lib/util/file-writer.js:57:9)
    at FileWriter.extend.writeFile (/project/node_modules/remap-istanbul/node_modules/istanbul/lib/util/file-writer.js:147:23)
    at /project/node_modules/remap-istanbul/node_modules/istanbul/lib/report/html.js:483:24
    at Array.forEach (native)
    at HtmlReport.Report.mix.writeFiles (/project/node_modules/remap-istanbul/node_modules/istanbul/lib/report/html.js:477:23)

Btw, the library is not on npm yet :(

Thank you!

@kitsonk
Copy link
Contributor

kitsonk commented Sep 7, 2015

Hmmm... that is interesting. I suspect something has gone awry in what is being submitted to the report writer. Do you get any issues when setting the report to "json"? And if not, would you mind providing that output?

Apologies for lack of npm. Should be shorted in the next day or so.

@adrigzr
Copy link
Author

adrigzr commented Sep 7, 2015

It only occurs when setting the report to "html". I can't post the json file for privacy reason, but I can tell you is a map generated by transpiling ES6 through babel and it contains the sources embedded in "sourcesContent". When I manually fix the exception by checking the object variable on the if above, it works fine.

Thanks to you for your time :)

@kitsonk
Copy link
Contributor

kitsonk commented Sep 8, 2015

Ok, if other reports write fine, I suspect this is an issue with Istanbul and taking a quick look, it does appear others have run into exactly the same issue: gotwarlost/istanbul#429

I am not sure exactly under what conditions it occurs, but I am going to mark this ticket external.

@dylans
Copy link
Contributor

dylans commented Jan 11, 2017

It seems unlikely that the current Istanbul is ever going to resolve this, but the PR at gotwarlost/istanbul#603 likely solves this issue.

Eventually the rewrite of Istanbul will be stable and it supports remapping capabilities based on our work in this project.

@dylans
Copy link
Contributor

dylans commented Oct 27, 2018

As noted earlier, we're not able to fix this, so closing as it requires a fix to old Istanbul. Users needing this should apply one of the suggested workarounds listed above.

@dylans dylans closed this as completed Oct 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants