EddyVerbruggen / EddyVerbruggen/nativescript-printer

starting trouble

Open
#13 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
38
Forks
12
PR merge metrics
No merged PRs in 30d

Description

i require the plugin in js. then i wrote var printer = new Printer()
it says Printer is not a constructor....
solve this error please.............
--------------------------------------------------------------------------------------------------------------
TypeError: Printer is not a constructor
File: "file:///data/data/org.nativescript.preview/files/app/views/shared/view-models/sub-product-view-model.js, line: 116, column: 18

StackTrace:
Frame: function:'SubProductListViewModel.viewModel.camera', file:'file:///data/data/org.nativescript.preview/files/app/views/shared/view-models/sub-product-view-model.js', line: 116, column: 19
Frame: function:'exports.camera', file:'file:///data/data/org.nativescript.preview/files/app/views/itemDetails/itemDetails.js', line: 30, column: 16
Frame: function:'Observable.notify', file:'file:///data/data/org.nativescript.preview/files/app/tns_modules/tns-core-modules/data/observable/observable.js', line: 110, column: 23
Frame: function:'Observable._emit', file:'file:///data/data/org.nativescript.preview/files/app/tns_modules/tns-core-modules/data/observable/observable.js', line: 127, column: 18
Frame: function:'ClickListenerImpl.onClick', file:'file:///data/data/org.nativescript.preview/files/app/tns_modules/tns-core-modules/ui/button/button.js', line: 26, column: 23

at com.tns.Runtime.callJSMethodNative(Native Method)
at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1101)
at com.tns.Runtime.callJSMethodImpl(Runtime.java:983)
at com.tns.Runtime.callJSMethod(Runtime.java:970)
at com.tns.Runtime.callJSMethod(Runtime.java:954)
at com.tns.Runtime.callJSMethod(Runtime.java:946)
at com.tns.gen.java.lang.Object_button_19_32_ClickListenerImpl.onClick(Object_button_19_32_ClickListenerImpl.java:17)
at android.view.View.performClick(View.java:5215)
at android.view.View$PerformClick.run(View.java:21193)
at android.os.Handler.handleCallback(Handler.java:742)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:157)
at android.app.ActivityThread.main(ActivityThread.java:5571)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:745)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:635)

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the require and Printer construction at sub-product-view-model.js line 116, using the stack trace and the call from itemDetails.js line 30. Compare that usage with the plugin's documented entry point and Android behavior. Done means the constructor error no longer occurs during the camera flow; no test file or reproduction project is provided.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
mobile
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.