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

Problem using tesseract.js #3268

Closed
codeyad opened this issue Dec 8, 2016 · 4 comments
Closed

Problem using tesseract.js #3268

codeyad opened this issue Dec 8, 2016 · 4 comments
Labels

Comments

@codeyad
Copy link

codeyad commented Dec 8, 2016

An uncaught Exception occurred on "main" thread.
java.lang.RuntimeException: Unable to create application com.tns.NativeScriptApplication: com.tns.NativeScriptException: 

Error calling module function 

Error calling module function 

Error calling module function 

Cannot compile /data/data/org.nativescript.barcodeapp/files/app/tns_modules/tesseract.js

SyntaxError: Unexpected token else
File: "/data/data/org.nativescript.barcodeapp/files/app/tns_modules/tesseract.js, line: 82, column: 12

StackTrace: 
	Frame: function:'require', file:'', line: 1, column: 266
	Frame: function:'', file:'/data/data/org.nativescript.barcodeapp/files/app/app.component.js', line: 5, column: 17
	Frame: function:'require', file:'', line: 1, column: 266
	Frame: function:'', file:'/data/data/org.nativescript.barcodeapp/files/app/app.module.js', line: 4, column: 23
	Frame: function:'require', file:'', line: 1, column: 266
	Frame: function:'', file:'/data/data/org.nativescript.barcodeapp/files/app/main.js', line: 4, column: 20
	Frame: function:'require', file:'', line: 1, column: 266


SyntaxError: Unexpected token else
File: "<unknown>, line: 1, column: 265

StackTrace: 
	Frame: function:'require', file:'', line: 1, column: 266
	Frame: function:'', file:'/data/data/org.nativescript.barcodeapp/files/app/app.component.js', line: 5, column: 17
	Frame: function:'require', file:'', line: 1, column: 266
	Frame: function:'', file:'/data/data/org.nativescript.barcodeapp/files/app/app.module.js', line: 4, column: 23
	Frame: function:'require', file:'', line: 1, column: 266
	Frame: function:'', file:'/data/data/org.nativescript.barcodeapp/files/app/main.js', line: 4, column: 20
	Frame: function:'require', file:'', line: 1, column: 266


SyntaxError: Unexpected token else
File: "<unknown>, line: 1, column: 265

StackTrace: 
	Frame: function:'require', file:'', line: 1, column: 266
	Frame: function:'', file:'/data/data/org.nativescript.barcodeapp/files/app/app.component.js', line: 5, column: 17
	Frame: function:'require', file:'', line: 1, column: 266
	Frame: function:'', file:'/data/data/org.nativescript.barcodeapp/files/app/app.module.js', line: 4, column: 23
	Frame: function:'require', file:'', line: 1, column: 266
	Frame: function:'', file:'/data/data/org.nativescript.barcodeapp/files/app/main.js', line: 4, column: 20
	Frame: function:'require', file:'', line: 1, column: 266


SyntaxError: Unexpected token else
File: "<unknown>, line: 1, column: 265

StackTrace: 
	Frame: function:'require', file:'', line: 1, column: 266
	Frame: function:'', file:'/data/data/org.nativescript.barcodeapp/files/app/app.component.js', line: 5, column: 17
	Frame: function:'require', file:'', line: 1, column: 266
	Frame: function:'', file:'/data/data/org.nativescript.barcodeapp/files/app/app.module.js', line: 4, column: 23
	Frame: function:'require', file:'', line: 1, column: 266
	Frame: function:'', file:'/data/data/org.nativescript.barcodeapp/files/app/main.js', line: 4, column: 20
	Frame: function:'require', file:'', line: 1, column: 266


SyntaxError: Unexpected token else
File: "<unknown>, line: 1, column: 265

StackTrace: 
	Frame: function:'require', file:'', line: 1, column: 266
	Frame: function:'', file:'/data/data/org.nativescript.barcodeapp/files/app/app.component.js', line: 5, column: 17
	Frame: function:'require', file:'', line: 1, column: 266
	Frame: function:'', file:'/data/data/org.nativescript.barcodeapp/files/app/app.module.js', line: 4, column: 23
	Frame: function:'require', file:'', line: 1, column: 266
	Frame: function:'', file:'/data/data/org.nativescript.barcodeapp/files/app/main.js', line: 4, column: 20
	Frame: function:'require', file:'', line: 1, column: 266


	at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4641)
	at android.app.ActivityThread.access$1500(ActivityThread.java:155)
	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1378)
	at android.os.Handler.dispatchMessage(Handler.java:102)
	at android.os.Looper.loop(Looper.java:135)
	at android.app.ActivityThread.main(ActivityThread.java:5343)
	at java.lang.reflect.Method.invoke(Native Method)
	at java.lang.reflect.Method.invoke(Method.java:372)
	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:905)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:700)
Caused by: com.tns.NativeScriptException: 

Error calling module function 

Error calling module function 

Error calling module function 

Cannot compile /data/data/org.nativescript.barcodeapp/files/app/tns_modules/tesseract.js

SyntaxError: Unexpected token else
File: "/data/data/org.nativescript.barcodeapp/files/app/tns_modules/tesseract.js, line: 82, column: 12

StackTrace: 
	Frame: function:'require', file:'', line: 1, column: 266
	Frame: function:'', file:'/data/data/org.nativescript.barcodeapp/files/app/app.component.js', line: 5, column: 17
	Frame: function:'require', file:'', line: 1, column: 266
	Frame: function:'', file:'/data/data/org.nativescript.barcodeapp/files/app/app.module.js', line: 4, column: 23
	Frame: function:'require', file:'', line: 1, column: 266
	Frame: function:'', file:'/data/data/org.nativescript.barcodeapp/files/app/main.js', line: 4, column: 20
	Frame: function:'require', file:'', line: 1, column: 266


SyntaxError: Unexpected token else
File: "<unknown>, line: 1, column: 265

StackTrace: 
	Frame: function:'require', file:'', line: 1, column: 266
	Frame: function:'', file:'/data/data/org.nativescript.barcodeapp/files/app/app.component.js', line: 5, column: 17
	Frame: function:'require', file:'', line: 1, column: 266
	Frame: function:'', file:'/data/data/org.nativescript.barcodeapp/files/app/app.module.js', line: 4, column: 23
	Frame: function:'require', file:'', line: 1, column: 266
	Frame: function:'', file:'/data/data/org.nativescript.barcodeapp/files/app/main.js', line: 4, column: 20
	Frame: function:'require', file:'', line: 1, column: 266


SyntaxError: Unexpected token else
File: "<unknown>, line: 1, column: 265

StackTrace: 
	Frame: function:'require', file:'', line: 1, column: 266
	Frame: function:'', file:'/data/data/org.nativescript.barcodeapp/files/app/app.component.js', line: 5, column: 17
	Frame: function:'require', file:'', line: 1, column: 266
	Frame: function:'', file:'/data/data/org.nativescript.barcodeapp/files/app/app.module.js', line: 4, column: 23
	Frame: function:'require', file:'', line: 1, column: 266
	Frame: function:'', file:'/data/data/org.nativescript.barcodeapp/files/app/main.js', line: 4, column: 20
	Frame: function:'require', file:'', line: 1, column: 266


SyntaxError: Unexpected token else
File: "<unknown>, line: 1, column: 265

StackTrace: 
	Frame: function:'require', file:'', line: 1, column: 266
	Frame: function:'', file:'/data/data/org.nativescript.barcodeapp/files/app/app.component.js', line: 5, column: 17
	Frame: function:'require', file:'', line: 1, column: 266
	Frame: function:'', file:'/data/data/org.nativescript.barcodeapp/files/app/app.module.js', line: 4, column: 23
	Frame: function:'require', file:'', line: 1, column: 266
	Frame: function:'', file:'/data/data/org.nativescript.barcodeapp/files/app/main.js', line: 4, column: 20
	Frame: function:'require', file:'', line: 1, column: 266


SyntaxError: Unexpected token else
File: "<unknown>, line: 1, column: 265

StackTrace: 
	Frame: function:'require', file:'', line: 1, column: 266
	Frame: function:'', file:'/data/data/org.nativescript.barcodeapp/files/app/app.component.js', line: 5, column: 17
	Frame: function:'require', file:'', line: 1, column: 266
	Frame: function:'', file:'/data/data/org.nativescript.barcodeapp/files/app/app.module.js', line: 4, column: 23
	Frame: function:'require', file:'', line: 1, column: 266
	Frame: function:'', file:'/data/data/org.nativescript.barcodeapp/files/app/main.js', line: 4, column: 20
	Frame: function:'require', file:'', line: 1, column: 266


	at com.tns.Runtime.runModule(Native Method)
	at com.tns.Runtime.runModule(Runtime.java:514)
	at com.tns.Runtime.run(Runtime.java:509)
	at com.tns.NativeScriptApplication.onCreate(NativeScriptApplication.java:17)
	at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1035)
	at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4638)
	... 9 more

@NickIliev
Copy link
Contributor

NickIliev commented Dec 8, 2016

@codeyad are you using a NativeScript plugin or your own implementation of tesseract.js.
Can you share with us your package.json, the code and the steps that are leading to this error?

@codeyad
Copy link
Author

codeyad commented Dec 8, 2016

@NickIliev im using the standard library from npm, this is my package.json

  "description": "NativeScript Application",
  "license": "SEE LICENSE IN <your-license-filename>",
  "readme": "NativeScript Application",
  "repository": "<fill-your-repository-here>",
  "nativescript": {
    "id": "org.nativescript.barcodeapp",
    "tns-android": {
      "version": "2.4.1"
    }
  },
  "dependencies": {
    "@angular/common": "2.2.1",
    "@angular/compiler": "2.2.1",
    "@angular/core": "2.2.1",
    "@angular/forms": "2.2.1",
    "@angular/http": "2.2.1",
    "@angular/platform-browser": "2.2.1",
    "@angular/platform-browser-dynamic": "2.2.1",
    "@angular/router": "3.2.1",
    "nativescript-angular": "1.2.0",
    "nativescript-camera": "0.0.8",
    "nativescript-theme-core": "^0.2.1",
    "reflect-metadata": "~0.1.8",
    "rxjs": "5.0.0-beta.12",
    "tesseract.js": "^1.0.10",
    "tns-core-modules": "2.4.2"
  },
  "devDependencies": {
    "babel-traverse": "6.19.0",
    "babel-types": "6.19.0",
    "babylon": "6.14.1",
    "lazy": "1.0.11",
    "nativescript-dev-android-snapshot": "^0.*.*",
    "nativescript-dev-typescript": "^0.3.2",
    "typescript": "^2.1.4",
    "zone.js": "~0.6.21"
  }
}

@NickIliev
Copy link
Contributor

@codeyad the thing is that the standard library is made for web and uses some DOM related properties that can not be handled by NatievScript. Instead of using the standard library you should either create a plugin for NativeScript or use one of the already created ones.

For example, I came across this one: https://github.com/EddyVerbruggen/nativescript-ocr

@lock
Copy link

lock bot commented Aug 29, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Aug 29, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants