-
-
Notifications
You must be signed in to change notification settings - Fork 198
Description
Environment
- CLI: 5.2.4
- Cross-platform modules: 5.2.2
- Android Runtime: 5.2.1
- iOS Runtime: 5.2.0
- Plugin(s): none
Describe the bug
I'm making a React renderer for NativeScript (try to stay calm). It depends upon tns-core-modules. However, when I install this React renderer as a dependency of a sample app, when building the sample app (whether with or without the --bundle flag), Xcode finds duplicates of tns-core-modules and thus tns-core-modules-widgets. This could be related to the webpack config (which is using the defaults from tns create sample --tsc)..?
# Where 'sample' is the app that consumes the React renderer library
cd sample
tns run ios --cleanTypescript typings conflicts:
Skipping node_modules folder! Use the syncAllFiles option to sync files from this folder.
Searching for devices...
Found peer TypeScript 3.1.6
../react-nativescript/node_modules/tns-core-modules/module.d.ts(69,5): error TS2300: Duplicate identifier 'markup'.
../react-nativescript/node_modules/tns-core-modules/module.d.ts(70,5): error TS2300: Duplicate identifier 'script'.
../react-nativescript/node_modules/tns-core-modules/module.d.ts(71,5): error TS2300: Duplicate identifier 'style'.
../react-nativescript/node_modules/tns-core-modules/tns-core-modules.d.ts(4,1): error TS6200: Definitions of the following identifiers conflict with those in another file: "audio", "beacon", "cspreport", "download", "embed", "eventsource", "favicon", "fetch", "font", "form", "frame", "hyperlink", "iframe", "image", "imageset", "import", "internal", "location", "manifest", "object", "ping", "plugin", "prefetch", "script", "serviceworker", "sharedworker", "subresource", "style", "track", "video", "worker", "xmlhttprequest", "xslt", HeaderInit, WeakRef
../react-nativescript/node_modules/tns-core-modules/tns-core-modules.d.ts(5,5): error TS2432: In an enum with multiple declarations, only one declaration can omit an initializer for its first enum element.
node_modules/tns-core-modules/module.d.ts(69,5): error TS2300: Duplicate identifier 'markup'.
node_modules/tns-core-modules/module.d.ts(70,5): error TS2300: Duplicate identifier 'script'.
node_modules/tns-core-modules/module.d.ts(71,5): error TS2300: Duplicate identifier 'style'.
node_modules/tns-core-modules/tns-core-modules.d.ts(4,1): error TS6200: Definitions of the following identifiers conflict with those in another file: "audio", "beacon", "cspreport", "download", "embed", "eventsource", "favicon", "fetch", "font", "form", "frame", "hyperlink", "iframe", "image", "imageset", "import", "internal", "location", "manifest", "object", "ping", "plugin", "prefetch", "script", "serviceworker", "sharedworker", "subresource", "style", "track", "video", "worker", "xmlhttprequest", "xslt", HeaderInit, WeakRef
Frameworks from tns-core-modules (e.g. TNSWidgets.framework) are referenced from both the consumer project and the library.
Xcode build...
error: unexpected duplicate task: CodeSign /Users/jamie/Documents/git/react-nativescript/sample/platforms/ios/build/Debug-iphonesimulator/sample.app/Frameworks/TNSWidgets.framework (in target 'sample')
error: unexpected duplicate task: CodeSign /Users/jamie/Documents/git/react-nativescript/sample/platforms/ios/build/Debug-iphonesimulator/sample.app/Frameworks/TNSWidgets.framework (in target 'sample')
error: Multiple commands produce '/Users/jamie/Documents/git/react-nativescript/sample/platforms/ios/build/Debug-iphonesimulator/sample.app/Frameworks/TNSWidgets.framework':
1) Target 'sample' has copy command from '/Users/jamie/Documents/git/react-nativescript/sample/node_modules/react-nativescript/node_modules/tns-core-modules-widgets/platforms/ios/TNSWidgets.framework' to '/Users/jamie/Documents/git/react-nativescript/sample/platforms/ios/build/Debug-iphonesimulator/sample.app/Frameworks/TNSWidgets.framework'
2) Target 'sample' has copy command from '/Users/jamie/Documents/git/react-nativescript/sample/node_modules/tns-core-modules-widgets/platforms/ios/TNSWidgets.framework' to '/Users/jamie/Documents/git/react-nativescript/sample/platforms/ios/build/Debug-iphonesimulator/sample.app/Frameworks/TNSWidgets.framework'
error: Multiple commands produce '/Users/jamie/Documents/git/react-nativescript/sample/platforms/ios/build/Debug-iphonesimulator/sample.app/Frameworks/TNSWidgets.framework/TNSWidgets':
1) Target 'sample' has copy command from '/Users/jamie/Documents/git/react-nativescript/sample/node_modules/react-nativescript/node_modules/tns-core-modules-widgets/platforms/ios/TNSWidgets.framework' to '/Users/jamie/Documents/git/react-nativescript/sample/platforms/ios/build/Debug-iphonesimulator/sample.app/Frameworks/TNSWidgets.framework'
2) Target 'sample' has copy command from '/Users/jamie/Documents/git/react-nativescript/sample/node_modules/tns-core-modules-widgets/platforms/ios/TNSWidgets.framework' to '/Users/jamie/Documents/git/react-nativescript/sample/platforms/ios/build/Debug-iphonesimulator/sample.app/Frameworks/TNSWidgets.framework'
warning: duplicate output file '/Users/jamie/Documents/git/react-nativescript/sample/platforms/ios/build/Debug-iphonesimulator/sample.app/Frameworks/TNSWidgets.framework' on task: PBXCp /Users/jamie/Documents/git/react-nativescript/sample/node_modules/tns-core-modules-widgets/platforms/ios/TNSWidgets.framework /Users/jamie/Documents/git/react-nativescript/sample/platforms/ios/build/Debug-iphonesimulator/sample.app/Frameworks/TNSWidgets.framework (in target 'sample')
warning: duplicate output file '/Users/jamie/Documents/git/react-nativescript/sample/platforms/ios/build/Debug-iphonesimulator/sample.app/Frameworks/TNSWidgets.framework/TNSWidgets' on task: PBXCp /Users/jamie/Documents/git/react-nativescript/sample/node_modules/tns-core-modules-widgets/platforms/ios/TNSWidgets.framework /Users/jamie/Documents/git/react-nativescript/sample/platforms/ios/build/Debug-iphonesimulator/sample.app/Frameworks/TNSWidgets.framework (in target 'sample')
warning: duplicate output file '' on task: PBXCp /Users/jamie/Documents/git/react-nativescript/sample/node_modules/tns-core-modules-widgets/platforms/ios/TNSWidgets.framework /Users/jamie/Documents/git/react-nativescript/sample/platforms/ios/build/Debug-iphonesimulator/sample.app/Frameworks/TNSWidgets.framework (in target 'sample')
note: Using new build systemnote: Planning buildnote: Constructing build description
** BUILD FAILED **
Unable to apply changes on device: A77F52A9-0201-47A7-8523-1F7C0CFBD57C. Error is: Command xcodebuild failed with exit code 65.
To Reproduce
- Create a library that depends on
tns-core-modules - Create an app that installs that library, and also depends upon (the same) version of
tns-core-modules
Expected behavior
App is supposed to build correctly.
Sample project
https://github.com/shirakaba/react-nativescript
Additional context
npm dedupe gets things working, but does also remove all the duplicate dependencies in your library folder, preventing you from developing your library.
npm ls# Lots of unrelated packages
├─┬ react-nativescript@0.1.0 -> /Users/jamie/Documents/git/react-nativescript/react-nativescript
│ ├── @types/react-reconciler@0.18.0 extraneous
│ ├─┬ react@16.8.5
│ │ ├─┬ loose-envify@1.4.0
│ │ │ └── js-tokens@4.0.0
│ │ ├── object-assign@4.1.1
│ │ ├─┬ prop-types@15.7.2
│ │ │ ├── loose-envify@1.4.0 deduped
│ │ │ ├── object-assign@4.1.1 deduped
│ │ │ └── react-is@16.8.5
│ │ └─┬ scheduler@0.13.5
│ │ ├── loose-envify@1.4.0 deduped
│ │ └── object-assign@4.1.1 deduped
│ ├─┬ react-reconciler@0.20.3
│ │ ├── loose-envify@1.4.0 deduped
│ │ ├── object-assign@4.1.1 deduped
│ │ ├── prop-types@15.7.2 deduped
│ │ └── scheduler@0.13.5 deduped
│ ├─┬ tns-core-modules@5.2.2
│ │ ├── tns-core-modules-widgets@5.2.0
│ │ └── tslib@1.9.3
│ └── typescript@3.3.4000 extraneous
└─┬ tns-core-modules@5.2.2
├── tns-core-modules-widgets@5.2.0
└── tslib@1.9.3
Note how tns-core-modules-widgets appears twice.
Related issues