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

riot cli in webstorm not compiling typescript with let or const #26

Closed
TimWillis opened this Issue Apr 17, 2017 · 8 comments

Comments

Projects
None yet
2 participants
@TimWillis

I am using riot cli in webstorm(don't think that matters), and I have a riot tag like this ->
<students_info> <div class="page_container" style=""> test </div> <script type="typescript"> let x = 1; </script> </students_info>
riot doesn't show any compile errors, but returns a js file with the word 'undefined' in it. if I change it to var it works. Other things like arrow functions and other things for typescript work fine as long as no let or const.

@GianlucaGuarini

This comment has been minimized.

Show comment
Hide comment
@GianlucaGuarini

GianlucaGuarini Apr 17, 2017

Member

have you properly configured typescript http://riotjs.com/guide/compiler/#typescript?

Member

GianlucaGuarini commented Apr 17, 2017

have you properly configured typescript http://riotjs.com/guide/compiler/#typescript?

@TimWillis

This comment has been minimized.

Show comment
Hide comment
@TimWillis

TimWillis Apr 17, 2017

@GianlucaGuarini

This comment has been minimized.

Show comment
Hide comment
@GianlucaGuarini

GianlucaGuarini Apr 17, 2017

Member

have you tried compiling via terminal? Could you please post your code?

Member

GianlucaGuarini commented Apr 17, 2017

have you tried compiling via terminal? Could you please post your code?

@TimWillis

This comment has been minimized.

Show comment
Hide comment
@TimWillis

TimWillis Apr 17, 2017

@GianlucaGuarini

This comment has been minimized.

Show comment
Hide comment
@GianlucaGuarini

GianlucaGuarini Apr 18, 2017

Member

If the compiler does not fail and the error is in your runtime script this is not a bug. The compiler scope is to output vaild javascript without compromising your program logic. In your case the issue was in your code. Good luck

Member

GianlucaGuarini commented Apr 18, 2017

If the compiler does not fail and the error is in your runtime script this is not a bug. The compiler scope is to output vaild javascript without compromising your program logic. In your case the issue was in your code. Good luck

@TimWillis

This comment has been minimized.

Show comment
Hide comment
@TimWillis

TimWillis Apr 18, 2017

OK, I found the issue, I thought I had a bug in my code, but it was something different. The following compiles fine in a ts file:
let workbook: any = XLSX.read({}, {type: 'binary'});
But when I put it in a tag file like the following, and either using the webstorm file watcher or the cli it returns the word undefined in the generated js file. Why would it compile in a ts file, but not in the tag file?

<student_settings> <div class="page_container" style=""> </div> <script type="typescript"> let workbook: any = XLSX.read({}, {type: 'binary'}); </script> </student_settings>

OK, I found the issue, I thought I had a bug in my code, but it was something different. The following compiles fine in a ts file:
let workbook: any = XLSX.read({}, {type: 'binary'});
But when I put it in a tag file like the following, and either using the webstorm file watcher or the cli it returns the word undefined in the generated js file. Why would it compile in a ts file, but not in the tag file?

<student_settings> <div class="page_container" style=""> </div> <script type="typescript"> let workbook: any = XLSX.read({}, {type: 'binary'}); </script> </student_settings>

@GianlucaGuarini

This comment has been minimized.

Show comment
Hide comment
@GianlucaGuarini

GianlucaGuarini Apr 18, 2017

Member

it should be fixed in riot-cli@3.0.1 thanks for reporting the issue

Member

GianlucaGuarini commented Apr 18, 2017

it should be fixed in riot-cli@3.0.1 thanks for reporting the issue

@TimWillis

This comment has been minimized.

Show comment
Hide comment
@TimWillis

TimWillis Apr 18, 2017

Awesome, thank you!

Awesome, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment