You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 --clean
Typescript 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
npm dedupe gets things working, but does also remove all the duplicate dependencies in your library folder, preventing you from developing your library.
@shirakaba in the plugin source remove the tns-core-modules from the dependency list. You could install the tns-core-modules as a devDepedency (e.g. as done here) and that won't prevent you from accessing the tns-core-modules in your plugin code (e.g. as done here) as each NativeScript project would have the tns-core-modules installed in the end (e.g. your demo called sample is installing tns-core-modules as dependency).
@shirakaba glad to hear you are able to move forward! As a side note I've read your roadmap and noticed that you need TSX support so perhaps you could refer to this plugin for inspiration.
@NickIliev That's invaluable, thank you! I'll add that as a note in the repo.
Before I can get as far as TSX, I'll first need to figure out how to bootstrap the app. I'll file this issue that I'm blocked on under the NativeScript main repository in a moment; would be glad of any help with that, as well!
Environment
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 oftns-core-modules
and thustns-core-modules-widgets
. This could be related to the webpack config (which is using the defaults fromtns create sample --tsc
)..?Typescript typings conflicts:
Frameworks from
tns-core-modules
(e.g.TNSWidgets.framework
) are referenced from both the consumer project and the library.To Reproduce
tns-core-modules
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.Note how
tns-core-modules-widgets
appears twice.Related issues
The text was updated successfully, but these errors were encountered: