Skip to content
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

Native Stack does not compile when isolatedModules flag is provided #449

Closed
niksudan opened this issue Apr 1, 2020 · 1 comment · Fixed by #475
Closed

Native Stack does not compile when isolatedModules flag is provided #449

niksudan opened this issue Apr 1, 2020 · 1 comment · Fixed by #475

Comments

@niksudan
Copy link

niksudan commented Apr 1, 2020

Attempting to compile react-native-screens/native-stack with the isolatedModules flag enabled throws the following error:

Cannot re-export a type when the '--isolatedModules' flag is provided.

This is caused by this line of code:

export {
  NativeStackNavigationOptions,
  NativeStackNavigationProp,
} from './types';

A solution for this is to upgrade to TypeScript 3.8 and then adding the type keyword:

export type { ... } from './types';

Naturally, this isn't great for backwards compatibility. There are some good workarounds provided in this StackOverflow thread.

In the meantime I've turned off the option as it's not really necessary for my project, but it's the only dependency that throws this error.

@WoLewicki
Copy link
Member

@niksudan can you provide a repo with minimal configuration needed to repro the issue so I can work on it?

WoLewicki added a commit that referenced this issue Apr 27, 2020
Upgraded dependencies, from which the most crucial is @babel since the newer version is needed for React-Navigation to work (react-navigation/react-navigation#7978 (comment)). Also, used TS 3.8 syntax in native-stack to resolve #449.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants