-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Emitted__exportStar helper has missing ; which causes runtime error #38501
Comments
alan-agius4
added a commit
to alan-agius4/TypeScript
that referenced
this issue
May 12, 2020
alan-agius4
added a commit
to alan-agius4/TypeScript
that referenced
this issue
May 12, 2020
alan-agius4
added a commit
to alan-agius4/TypeScript
that referenced
this issue
May 12, 2020
alan-agius4
added a commit
to alan-agius4/TypeScript
that referenced
this issue
May 12, 2020
alan-agius4
added a commit
to petebacondarwin/angular
that referenced
this issue
May 12, 2020
This is a workaround for a TS 3.9 regression microsoft/TypeScript#38501 As good citezens most of our users will be using `importHelpers` anyways, to avoid emitting typescript helpers multiple times
alan-agius4
added a commit
to petebacondarwin/angular
that referenced
this issue
May 12, 2020
This is a workaround for a TS 3.9 regression microsoft/TypeScript#38501 As good citizens most of our users will be using `importHelpers` anyways, to avoid emitting typescript helpers multiple times
alan-agius4
added a commit
to petebacondarwin/angular
that referenced
this issue
May 12, 2020
This is a workaround for a TS 3.9 regression microsoft/TypeScript#38501 where the emitted `__exportStar` helpers have a missing semi-colon at the end of the unnamed function, when targetting UMD, and causes the following runtime error `Uncaught TypeError: (intermediate value)(…) is not a function`. This is because the anonymous `__exportStar` function will be invoked with the function on the next like as the parameter which is subsequently invoking whatever was returned. To get around this TS bug, add `importHelpers: true` in your tsconfig. This also, is recommanded to avoid multiple copies of the same helper being inlined, which might cause increase in bundle size.
petebacondarwin
pushed a commit
to petebacondarwin/angular
that referenced
this issue
May 12, 2020
This is a workaround for a TS 3.9 regression microsoft/TypeScript#38501 where the emitted `__exportStar` helpers have a missing semi-colon at the end of the unnamed function, when targetting UMD, and causes the following runtime error `Uncaught TypeError: (intermediate value)(…) is not a function`. This is because the anonymous `__exportStar` function will be invoked with the function on the next like as the parameter which is subsequently invoking whatever was returned. To get around this TS bug, add `importHelpers: true` in your tsconfig. This also, is recommanded to avoid multiple copies of the same helper being inlined, which might cause increase in bundle size.
Please port the change to tslib |
On it @DanielRosenwasser |
alan-agius4
added a commit
to alan-agius4/tslib
that referenced
this issue
May 12, 2020
Sorry, no, I didn't mean to ask you! Though I just made the change as well! 😅 |
@DanielRosenwasser, I did the change to tslib microsoft/tslib#101 though that shouldn't have any effect, since it's not followed by immediate function call. |
Thanks @alan-agius4! |
petebacondarwin
pushed a commit
to petebacondarwin/angular
that referenced
this issue
May 13, 2020
This is a workaround for a TS 3.9 regression microsoft/TypeScript#38501 where the emitted `__exportStar` helpers have a missing semi-colon at the end of the unnamed function, when targetting UMD, and causes the following runtime error `Uncaught TypeError: (intermediate value)(…) is not a function`. This is because the anonymous `__exportStar` function will be invoked with the function on the next like as the parameter which is subsequently invoking whatever was returned. To get around this TS bug, add `importHelpers: true` in your tsconfig. This also, is recommanded to avoid multiple copies of the same helper being inlined, which might cause increase in bundle size.
petebacondarwin
pushed a commit
to petebacondarwin/angular
that referenced
this issue
May 13, 2020
This is a workaround for a TS 3.9 regression microsoft/TypeScript#38501 where the emitted `__exportStar` helpers have a missing semi-colon at the end of the unnamed function, when targetting UMD, and causes the following runtime error `Uncaught TypeError: (intermediate value)(…) is not a function`. This is because the anonymous `__exportStar` function will be invoked with the function on the next like as the parameter which is subsequently invoking whatever was returned. To get around this TS bug, add `importHelpers: true` in your tsconfig. This also, is recommanded to avoid multiple copies of the same helper being inlined, which might cause increase in bundle size.
IgorMinar
pushed a commit
to petebacondarwin/angular
that referenced
this issue
May 14, 2020
This is a workaround for a TS 3.9 regression microsoft/TypeScript#38501 where the emitted `__exportStar` helpers have a missing semi-colon at the end of the unnamed function, when targetting UMD, and causes the following runtime error `Uncaught TypeError: (intermediate value)(…) is not a function`. This is because the anonymous `__exportStar` function will be invoked with the function on the next like as the parameter which is subsequently invoking whatever was returned. To get around this TS bug, add `importHelpers: true` in your tsconfig. This also, is recommanded to avoid multiple copies of the same helper being inlined, which might cause increase in bundle size.
kara
pushed a commit
to angular/angular
that referenced
this issue
May 14, 2020
This is a workaround for a TS 3.9 regression microsoft/TypeScript#38501 where the emitted `__exportStar` helpers have a missing semi-colon at the end of the unnamed function, when targetting UMD, and causes the following runtime error `Uncaught TypeError: (intermediate value)(…) is not a function`. This is because the anonymous `__exportStar` function will be invoked with the function on the next like as the parameter which is subsequently invoking whatever was returned. To get around this TS bug, add `importHelpers: true` in your tsconfig. This also, is recommanded to avoid multiple copies of the same helper being inlined, which might cause increase in bundle size. PR Close #36989
Should be fixed now |
profanis
pushed a commit
to profanis/angular
that referenced
this issue
Sep 5, 2020
This is a workaround for a TS 3.9 regression microsoft/TypeScript#38501 where the emitted `__exportStar` helpers have a missing semi-colon at the end of the unnamed function, when targetting UMD, and causes the following runtime error `Uncaught TypeError: (intermediate value)(…) is not a function`. This is because the anonymous `__exportStar` function will be invoked with the function on the next like as the parameter which is subsequently invoking whatever was returned. To get around this TS bug, add `importHelpers: true` in your tsconfig. This also, is recommanded to avoid multiple copies of the same helper being inlined, which might cause increase in bundle size. PR Close angular#36989
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
TypeScript Version: 3.9.1-rc
Search Terms:
__exportStar
export star
Code
Input
Output
When module target is configured UMD and helpers are emitted. The
__exportStar
unnamed function declaration has a missing;
, which causes an error during runtimeUncaught TypeError: (intermediate value)(…) is not a function
Expected behavior:
A semi-colon is added after the unnamed
__exportStar
function declaration.Actual behavior:
A semi-colon is missing from the output which cause a runtime error.
Playground Link: https://www.typescriptlang.org/play/?module=3&ts=4.0.0-dev.20200511&ssl=2&ssc=18&pln=2&pc=1#code/KYDwDg9gTgLgBAKjgMyhAtnA5AOgPQzADOMWA3AFBA
The text was updated successfully, but these errors were encountered: