-
-
Notifications
You must be signed in to change notification settings - Fork 26.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
Can't use named exports for TypeScript types? #6570
Comments
You can check through the tracker for other issues about this to learn more about the why, but I think the short answer is that it's a limitation of using babel to compile typescript, and so yeah you are limited by whatever restrictions |
Hmm, do you think this could be better documented in the
Which doesn't exactly seem to be the case as the Also, it mentions:
But I guess the |
Have you tried Here's some related info: microsoft/TypeScript#21194 |
@ianschmitz Yes that works, I mentioned in the first comment that this way would work. I just think it's problematic that a certain style of coding is not allowed and is not mentioned anywhere |
There's not much we can do on our end. This is expected behavior from TypeScript with |
Is this a bug report?
Yes
Did you try recovering your dependencies?
Not relevant.
Which terms did you search for in User Guide?
TypeScript
Environment
System:
OS: macOS 10.14.2
CPU: x64 Intel(R) Core(TM) i7-4980HQ CPU @ 2.80GHz
Binaries:
Node: 8.12.0 - ~/.nvm/versions/node/v8.12.0/bin/node
Yarn: 1.5.1 - /usr/local/bin/yarn
npm: 6.4.1 - ~/.nvm/versions/node/v8.12.0/bin/npm
Browsers:
Chrome: 72.0.3626.119
Firefox: 65.0
Safari: 12.0.2
npmPackages:
react: ^16.8.3 => 16.8.3
react-dom: ^16.8.3 => 16.8.3
react-scripts: 2.1.5 => 2.1.5
npmGlobalPackages:
create-react-app: 2.1.5
Steps to Reproduce
create-react-app --typescript example
src
calledtypes.ts
types.ts
:Expected Behavior
This should be fine.
Actual Behavior
I can't remove the
--isolatedModules
flag becausecreate-react-app
seems to put it back in automatically when it compiles. Is there really no way to fix this issue other than having to useexport interface X
andexport interface Y
everywhere instead ofexport { X, Y }
?Reproducible Demo
I can make one if necessary, but its basically just a new app with an exported type.
The text was updated successfully, but these errors were encountered: