triniwiz / fancycamera

MIT License
8 stars 13 forks source link

Cannot run demo under NS7 #23

Open mrwrighty opened 3 years ago

mrwrighty commented 3 years ago

Trying to understand the new fancyCamera plugin for Nativescript but cannot run the demo under NS7. Receive the following errors.

ERROR in app.ts:1:31 TS2307: Cannot find module 'tns-core-modules/application' or its corresponding type declarations.

1 | import * as application from 'tns-core-modules/application'; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2 | application.start({ moduleName: "main-page" }); 3 |

ERROR in main-page.ts:1:29 TS2307: Cannot find module 'tns-core-modules/data/observable' or its corresponding type declarations.

1 | import as observable from 'tns-core-modules/data/observable'; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2 | import as pages from 'tns-core-modules/ui/page'; 3 | import { HelloWorldModel } from './main-view-model'; 4 | import { FancyCamera } from 'nativescript-fancy-camera';

ERROR in main-page.ts:2:24 TS2307: Cannot find module 'tns-core-modules/ui/page' or its corresponding type declarations. 1 | import * as observable from 'tns-core-modules/data/observable';

2 | import * as pages from 'tns-core-modules/ui/page'; | ^^^^^^^^^^^^^^^^^^^^^^^^^^ 3 | import { HelloWorldModel } from './main-view-model'; 4 | import { FancyCamera } from 'nativescript-fancy-camera'; 5 |

ERROR in main-page.ts:8:4 TS2339: Property 'set' does not exist on type 'HelloWorldModel'. 6 | let page; 7 | let vm = new HelloWorldModel();

8 | vm.set('isRecording', false); | ^^^ 9 | let fc = new FancyCamera(); 10 | 11 |

ERROR in main-page.ts:24:12 TS2339: Property 'set' does not exist on type 'HelloWorldModel'. 22 | const object = args.object; 23 | const file = object.get('file');

24 | vm.set('hasVideo', true); | ^^^ 25 | vm.set('hasImage', true); 26 | vm.set('src', file); 27 | });

ERROR in main-page.ts:25:12 TS2339: Property 'set' does not exist on type 'HelloWorldModel'. 23 | const file = object.get('file'); 24 | vm.set('hasVideo', true);

25 | vm.set('hasImage', true); | ^^^ 26 | vm.set('src', file); 27 | }); 28 | cameraView.takePhoto();

ERROR in main-page.ts:26:12 TS2339: Property 'set' does not exist on type 'HelloWorldModel'. 24 | vm.set('hasVideo', true); 25 | vm.set('hasImage', true);

26 | vm.set('src', file); | ^^^ 27 | }); 28 | cameraView.takePhoto(); 29 | }

ERROR in main-page.ts:41:12 TS2339: Property 'set' does not exist on type 'HelloWorldModel'. 39 | const object = args.object; 40 | const file = object.get('file');

41 | vm.set('hasImage', false); | ^^^ 42 | vm.set('hasVideo', true); 43 | vm.set('src', file); 44 | });

ERROR in main-page.ts:42:12 TS2339: Property 'set' does not exist on type 'HelloWorldModel'. 40 | const file = object.get('file'); 41 | vm.set('hasImage', false);

42 | vm.set('hasVideo', true); | ^^^ 43 | vm.set('src', file); 44 | }); 45 | cameraView.startRecording();

ERROR in main-page.ts:43:12 TS2339: Property 'set' does not exist on type 'HelloWorldModel'. 41 | vm.set('hasImage', false); 42 | vm.set('hasVideo', true);

43 | vm.set('src', file); | ^^^ 44 | }); 45 | cameraView.startRecording(); 46 | }

ERROR in main-page.ts:56:16 TS2339: Property 'set' does not exist on type 'HelloWorldModel'. 54 | fc.takePhoto().then(data => { 55 | if (data && data.file) {

56 | vm.set('hasVideo', false); | ^^^ 57 | vm.set('hasImage', true); 58 | vm.set('src', data.file); 59 | }

ERROR in main-page.ts:57:16 TS2339: Property 'set' does not exist on type 'HelloWorldModel'. 55 | if (data && data.file) { 56 | vm.set('hasVideo', false);

57 | vm.set('hasImage', true); | ^^^ 58 | vm.set('src', data.file); 59 | } 60 | });

ERROR in main-page.ts:58:16 TS2339: Property 'set' does not exist on type 'HelloWorldModel'. 56 | vm.set('hasVideo', false); 57 | vm.set('hasImage', true);

58 | vm.set('src', data.file); | ^^^ 59 | } 60 | }); 61 | }

ERROR in main-page.ts:66:16 TS2339: Property 'set' does not exist on type 'HelloWorldModel'. 64 | fc.record().then(data => { 65 | if (data && data.file) {

66 | vm.set('hasImage', false); | ^^^ 67 | vm.set('hasVideo', true); 68 | vm.set('src', data.file); 69 | }

ERROR in main-page.ts:67:16 TS2339: Property 'set' does not exist on type 'HelloWorldModel'. 65 | if (data && data.file) { 66 | vm.set('hasImage', false);

67 | vm.set('hasVideo', true); | ^^^ 68 | vm.set('src', data.file); 69 | } 70 | });

ERROR in main-page.ts:68:16 TS2339: Property 'set' does not exist on type 'HelloWorldModel'. 66 | vm.set('hasImage', false); 67 | vm.set('hasVideo', true);

68 | vm.set('src', data.file); | ^^^ 69 | } 70 | }); 71 | }

ERROR in main-page.ts:77:20 TS2339: Property 'set' does not exist on type 'HelloWorldModel'. 75 | if (data && data.file && data.type) { 76 | if (data.type === 'video') {

77 | vm.set('hasImage', false); | ^^^ 78 | vm.set('hasVideo', true); 79 | } 80 |

ERROR in main-page.ts:78:20 TS2339: Property 'set' does not exist on type 'HelloWorldModel'. 76 | if (data.type === 'video') { 77 | vm.set('hasImage', false);

78 | vm.set('hasVideo', true); | ^^^ 79 | } 80 | 81 | if (data.type === 'photo') {

ERROR in main-page.ts:82:20 TS2339: Property 'set' does not exist on type 'HelloWorldModel'. 80 | 81 | if (data.type === 'photo') {

82 | vm.set('hasImage', true); | ^^^ 83 | vm.set('hasVideo', false); 84 | } 85 |

ERROR in main-page.ts:83:20 TS2339: Property 'set' does not exist on type 'HelloWorldModel'. 81 | if (data.type === 'photo') { 82 | vm.set('hasImage', true);

83 | vm.set('hasVideo', false); | ^^^ 84 | } 85 | 86 |

ERROR in main-page.ts:87:16 TS2339: Property 'set' does not exist on type 'HelloWorldModel'. 85 | 86 |

87 | vm.set('src', data.file); | ^^^ 88 | } 89 | }); 90 | }

ERROR in main-view-model.ts:1:28 TS2307: Cannot find module 'tns-core-modules/data/observable' or its corresponding type declarations.

1 | import { Observable } from 'tns-core-modules/data/observable'; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2 | 3 | export class HelloWorldModel extends Observable { 4 |

triniwiz commented 3 years ago

Ah I really did not know anyone used the fc plugin 😅 I'll migrate the code in the monorepo 😃

mrwrighty commented 3 years ago

Previously used the advanced videorecorder plugin in a Nativescript app and having to recode for the new plugin fancy-camera assuming that Videorecorder no longer works under NS7 certainly my migrated code is not running the video element.