-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Ambient const enums are not allowed when the '--isolatedModules' flag is provided (with typescript) #4538
Comments
I'm not familiar with the error, but I have a hunch that it might be addressed by the enum being exported in this PR: #4514 |
This also causes compilation errors with @babel/plugin-transform-typescript (the TypeScript compiler used in create-react-app), which does not support const enums. EDIT: I've created issue #4555 to track this separately. |
@BrianMitchL Although it also pertains to const enums, your issue is unrelated to this one. Please open an issue and fill out the template - including all relevant version information. IIRC, TypeScript 2.4 is the version in which const enums were introduced, so I'd be more than a little surprised if the current version of the transform does not support them. Anyway, please move all discussion to a new issue. |
@steabert I just ran into this issue after running a
Downgrading rxjs from 6.4.0 to 6.3.3 removed that error.
I'm not sure if this is helpful 🤷♂️ One last thought, I'm not too sure if you need to |
@am17torres Yeah, exporting won't solve this. See this comment. |
We're facing this issue too, and I think it's going to affect a lot of people sadly. Any ideas for workarounds? For now we're forcing the last release (using Yarn's Would the quick fix be to remove |
@mrmckeb I think pinning your resolution to 6.3.3 would be the quickest, simplest solution, for now. |
* fix(Notification): replace const enum Closes ReactiveX#4538 * chore: use literal union and keep enum The enum is kept, but it is no longer a const enum. It cannot be exported as a const enum without effecting an error if isolated modules are used.
Bug Report
Current Behavior
When compiling a typescript file that imports something from
rxjs
with theisolatedModules
option for typescript set to true, the following error occurs:Reproduction
Create minimal project
Create
test.ts
:Run Typescript compiler
Expected behavior
No error.
Environment
Possible Solution
Additional context/Screenshots
Add any other context about the problem here. If applicable, add screenshots to help explain.
The text was updated successfully, but these errors were encountered: