-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
importsNotUsedAsValues in JS files elides imports incorrectly #38412
Labels
Milestone
Comments
This was referenced May 8, 2020
RyanCavanaugh
added
the
Needs Investigation
This issue needs a team member to investigate its status.
label
May 8, 2020
Note: this bug is also present in 3.8 & 3.9. |
clydin
pushed a commit
to angular/angular-cli
that referenced
this issue
May 11, 2020
With this change we "vendor" TypeScript 3.6 in build optimizer instead of using directly the npm package. Reasons: - We cannot update to a more recent version of TypeScript due to microsoft/TypeScript#38412 - Yarn workspace are not supported under Bazel. This means currently we are running unit testswhich uses a different TypeScript version at runtime. - In TypeScript 3.9, the shape of ES2015 classes changed microsoft/TypeScript#32011, this requires some changes in the UT expects, but this again will not be correct to change now.
andrewbranch
added
Bug
A bug in TypeScript
Fix Available
A PR has been opened for this issue
and removed
Needs Investigation
This issue needs a team member to investigate its status.
labels
Jun 9, 2020
Merged
mhevery
pushed a commit
to angular/angular
that referenced
this issue
Jun 11, 2020
Build-optimizer currently uses TypeScript 3.6 which is unable to resolve an 'accessor' in 'getTypeOfVariableOrParameterOrPropertyWorker'. Unfortunately, in Build optimizer we cannot update the version of TypeScript because of microsoft/TypeScript#38412 PR Close #37456
mhevery
pushed a commit
to angular/angular
that referenced
this issue
Jun 11, 2020
Build-optimizer currently uses TypeScript 3.6 which is unable to resolve an 'accessor' in 'getTypeOfVariableOrParameterOrPropertyWorker'. Unfortunately, in Build optimizer we cannot update the version of TypeScript because of microsoft/TypeScript#38412 PR Close #37456
ngwattcos
pushed a commit
to ngwattcos/angular
that referenced
this issue
Jun 25, 2020
…lar#37456) Build-optimizer currently uses TypeScript 3.6 which is unable to resolve an 'accessor' in 'getTypeOfVariableOrParameterOrPropertyWorker'. Unfortunately, in Build optimizer we cannot update the version of TypeScript because of microsoft/TypeScript#38412 PR Close angular#37456
profanis
pushed a commit
to profanis/angular
that referenced
this issue
Sep 5, 2020
…lar#37456) Build-optimizer currently uses TypeScript 3.6 which is unable to resolve an 'accessor' in 'getTypeOfVariableOrParameterOrPropertyWorker'. Unfortunately, in Build optimizer we cannot update the version of TypeScript because of microsoft/TypeScript#38412 PR Close angular#37456
https://codesandbox.io/s/typescript-importsnotusedasvalues-preserve-bug-demo-qm23x |
This was referenced Apr 15, 2021
@milahu would you mind opening a new issue? |
#43693 (sorry for the noise) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
TypeScript Version: 4.0.0-dev.20200508
Search Terms:
importsNotUsedAsValues
import eliding
Code
In TypeScript 3.8, a new
importsNotUsedAsValues
feature/compilerOption was added. This, however is producing different output based on if the file is.ts
or.js
.tsconfig.json
test.js
Output
Removing the
importsNotUsedAsValues
option, which is equivalent of having the value ofremove
will produce:Changing the file extension from
.js
to.ts
will produce the correct output for both casesExpected behavior:
Actual behavior:
Playground Link: Playground doesn't have the
importsNotUsedAsValues
options.Related Issues: None that I can find.
The text was updated successfully, but these errors were encountered: