-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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 #7110
Comments
We're actually in the middle of addressing this issue. Half of it landed last night: a995de2 I'm working on the icon names and const enums across more packages now. |
If you feel that this is resolved, please feel free to close this. We're taking an approach of carefully moving over to something other than const enum trying to figure out the implications of size differences in the package before and after. It'll likely take a few more days to completely land. |
I'm hitting this right now, should this be re-opened? |
If you are on latest version and there are still global exported enums, than definitely should be. PS: until they are cooperating with TS guys to address this problem on TS behalf. |
@kenotron I'm hitting this with the latest packages right now because of the icon names. You mentioned that you'd fixed part 1 of 2 so if there is another issue tracking part 2 please feel free to resolve as dupe. |
Hey @cschleiden - yeah we haven't finished the work yet, though you can track it here: #7119 |
Hi is there any progress on the matter? still same behavior. Seems to be critical as it totally blocks using the fabricui in react+typescript app |
@dushes-ag : @kenotron and I will be tackling the matter of That said, in the meantime, One way around this that lets you still use CRA is to use npx create-react-app my-app --scripts-version=react-scripts-ts |
@Jahnp is there any other known work around since |
@drewloomer oh shoot, I didn't realize that was the case. I'm not aware of another work around right now. We'll have to get back to you on that. There's a decent chance we'll be removing the |
@drewloomer What I'm doing as a work around is going to the IconNames.d.ts file within node_modules and I'm simply removing the |
I was able to suppress this without making code changes to prepackaged code by setting |
@Jahnp It looks like the only const enum issue left is the icons, correct? Can we open up an issue specifically for icons and close this one up? |
Any updates on this issue? |
@BTC-Bradley - after a lot of thinking on this issue, we're gonna deprecate the IconNames module. Most of consumers are using https://uifabricicons.azurewebsites.net/?help It's not the resolution you probably want, but in a rare occasion I'm actually recommending against having a real type here so far. We can probably do better in a later major rev of Fabric where we could export little constants (e.g. |
Ooops, just saw @JasonGore marking the newer bug resolved. I'm gonna keep this one open for the @deprecated work |
🎉This issue was addressed in #8005, which has now been successfully released as Handy links: |
🎉This issue was addressed in #8005, which has now been successfully released as Handy links: |
Thanks @kenotron for the quick response! |
@kenotron, would it also be possible to remove the const from the enum since it's deprecated? This would resolve the error for this issue until the enum is completely removed. |
@fabricteam can you please assist with BTC-Bradley issue. I'm also facing it... |
I still have the IconNames issue using "office-ui-fabric-react": "^6.164.8". The only fix that works is to remove the const. |
The @fabricteam has marked the enum as deprecated and I've been told it is set to be removed in the next major release 7.0. Until then, I have been using a simple (kinda hacky) script in my React app to automatically remove the const before building/starting. Sharing here in case anyone finds it useful: Add replace-in-file to dev dependencies:
Paste this code to
Modify package.json:
|
just change the = to : and export as a type |
Project created with create-react-app 2.1 with TS 3.1.6 is not compiling and falling with error:
Project dependencies:
The text was updated successfully, but these errors were encountered: