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

Appcenter's @types/node clash with @types/react-native #437

Closed
hojberg opened this issue May 14, 2018 · 7 comments
Closed

Appcenter's @types/node clash with @types/react-native #437

hojberg opened this issue May 14, 2018 · 7 comments

Comments

@hojberg
Copy link

hojberg commented May 14, 2018

Appcenter pulls in @types/node which clashes with @types/react-native which re-defines some of the functionality from @types/node which ends up with a lot of compiler errors.

I'm not sure the best way to resolve this?

See DefinitelyTyped/DefinitelyTyped#15960 for related topic.

@amchew
Copy link
Contributor

amchew commented May 14, 2018

Hey @hojberg, I'm sorry, I don't quite understand what you mean. Did you mean "App Center pulls in crashes that re-defines the functionality that results in a lot of compiler errors"? Would you mind please rephrasing your question? :)

@hojberg
Copy link
Author

hojberg commented May 15, 2018

@amchew Appcenter pulls in a dependency that pulls in @types/node. @types/react-native has similar definitions to that. Specifically they both define require which causes compilation errors (see the DefinitelyType issue I linked)

I think this PR: I think #424 fixes the issue by moving the dependency, but there does not seem to be a release out yet.

Errors are like linked in the issue:

../node_modules/@types/node/index.d.ts(49,13): error TS2451: Cannot redeclare block-scoped variable 'global'.
../node_modules/@types/node/index.d.ts(73,13): error TS2300: Duplicate identifier 'require'.
../node_modules/@types/react-native/index.d.ts(8541,11): error TS2451: Cannot redeclare block-scoped variable 'global'.
../node_modules/@types/react-native/index.d.ts(8542,14): error TS2300: Duplicate identifier 'require'.

@christav
Copy link

@hojberg What are you trying to do here? Are you trying to build the appcenter cli into a react native app?

@hojberg
Copy link
Author

hojberg commented May 16, 2018

We're using the appcenter-cli for automated deploys and want to add it to our package as a dev dependency for our deploy tools to work with it.

We got around this with a sub folder install. Either way I think the PR that i mentioned fixes this as it moved the dependencies around, but has not been released yet.

@christav
Copy link

That PR should have been released in version 1.0.16. I just released 1.0.17, please give that one a try.

Although with this scenario I think the sub folder install would be the supported way to do this sort of thing - I don't want to commit to maintaining compatibility with arbitrary other packages that somebody might embed the code into.

@amchew
Copy link
Contributor

amchew commented May 19, 2018

Hey @hojberg, our CLI v1.0.17 was just released on May 17 - could you please give that a try? It should solve your issue - let us know if not.

@hojberg
Copy link
Author

hojberg commented May 20, 2018

Hmm it did not, I had thought having the dependency in dev would have solved this. For now i've gone with the sub folder solution.

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

No branches or pull requests

3 participants