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

Throwing errors when calling TesseractPlugin.loadLanguage #30

Open
gianlazz opened this issue Aug 10, 2017 · 1 comment
Open

Throwing errors when calling TesseractPlugin.loadLanguage #30

gianlazz opened this issue Aug 10, 2017 · 1 comment

Comments

@gianlazz
Copy link

Here's what I've got

import { Component } from '@angular/core';
import { NavController, NavParams } from 'ionic-angular';

/**
 * Generated class for the MainPage page.
 *
 * See http://ionicframework.com/docs/components/#navigation for more info
 * on Ionic pages and navigation.
 */

@Component({
  selector: 'page-main',
  templateUrl: 'main.html',
})
export class MainPage {

  constructor(public navCtrl: NavController, public navParams: NavParams) {
  }

  ionViewDidLoad() {
    console.log('ionViewDidLoad MainPage');
  }

    TesseractPlugin.loadLanguage(language, function(response) {
  deferred.resolve(response);
}, function(reason) {
  deferred.reject('Error on loading OCR file for your language. ' + reason);
});
}

Error Produced:

[22:30:38]  typescript: src/pages/main/main.ts, line: 24
            ';' expected.

      L24:      TesseractPlugin.loadLanguage(language, function(response) {
      L25:    deferred.resolve(response);

[22:30:38]  typescript: src/pages/main/main.ts, line: 24
            Parameter declaration expected.

      L24:      TesseractPlugin.loadLanguage(language, function(response) {
      L25:    deferred.resolve(response);

[22:30:38]  typescript: src/pages/main/main.ts, line: 26
            Unexpected token. A constructor, method, accessor, or property was expected.

      L25:    deferred.resolve(response);
      L26:  }, function(reason) {
      L27:    deferred.reject('Error on loading OCR file for your language. ' + reason);

[22:30:38]  typescript: src/pages/main/main.ts, line: 28
            Unexpected token. A constructor, method, accessor, or property was expected.

      L27:    deferred.reject('Error on loading OCR file for your language. ' + reason);
      L28:  });

[22:30:38]  typescript: src/pages/main/main.ts, line: 24
            Duplicate function implementation.

      L24:      TesseractPlugin.loadLanguage(language, function(response) {
      L25:    deferred.resolve(response);

[22:30:38]  typescript: src/pages/main/main.ts, line: 25
            Cannot find name 'deferred'.

      L24:      TesseractPlugin.loadLanguage(language, function(response) {
      L25:    deferred.resolve(response);
      L26:  }, function(reason) {

[22:30:38]  typescript: src/pages/main/main.ts, line: 26
            Duplicate function implementation.

      L25:    deferred.resolve(response);
      L26:  }, function(reason) {
      L27:    deferred.reject('Error on loading OCR file for your language. ' + reason);

[22:30:38]  typescript: src/pages/main/main.ts, line: 27
            Cannot find name 'deferred'.

      L26:  }, function(reason) {
      L27:    deferred.reject('Error on loading OCR file for your language. ' + reason);
      L28:  });

[22:30:38]  build finished in 9.67 s

[22:30:38]  build started ...
[22:30:38]  transpile update started ...
[22:30:38]  transpile update finished in 83 ms
[22:30:38]  deeplinks update started ...
[22:30:38]  deeplinks update finished in 56 ms
[22:30:38]  webpack update started ...
[22:30:40]  webpack update finished in 1.32 s
[22:30:44]  typescript: src/pages/main/main.ts, line: 24
            ';' expected.

      L24:      TesseractPlugin.loadLanguage(language, function(response) {
      L25:    deferred.resolve(response);

[22:30:44]  typescript: src/pages/main/main.ts, line: 24
            Parameter declaration expected.

      L24:      TesseractPlugin.loadLanguage(language, function(response) {
      L25:    deferred.resolve(response);

[22:30:44]  typescript: src/pages/main/main.ts, line: 26
            Unexpected token. A constructor, method, accessor, or property was expected.

      L25:    deferred.resolve(response);
      L26:  }, function(reason) {
      L27:    deferred.reject('Error on loading OCR file for your language. ' + reason);

[22:30:44]  typescript: src/pages/main/main.ts, line: 28
            Unexpected token. A constructor, method, accessor, or property was expected.

      L27:    deferred.reject('Error on loading OCR file for your language. ' + reason);
      L28:  });

[22:30:44]  typescript: src/pages/main/main.ts, line: 24
            Duplicate function implementation.

      L24:      TesseractPlugin.loadLanguage(language, function(response) {
      L25:    deferred.resolve(response);

[22:30:44]  typescript: src/pages/main/main.ts, line: 25
            Cannot find name 'deferred'.

      L24:      TesseractPlugin.loadLanguage(language, function(response) {
      L25:    deferred.resolve(response);
      L26:  }, function(reason) {

[22:30:44]  typescript: src/pages/main/main.ts, line: 26
            Duplicate function implementation.

      L25:    deferred.resolve(response);
      L26:  }, function(reason) {
      L27:    deferred.reject('Error on loading OCR file for your language. ' + reason);

[22:30:44]  typescript: src/pages/main/main.ts, line: 27
            Cannot find name 'deferred'.

      L26:  }, function(reason) {
      L27:    deferred.reject('Error on loading OCR file for your language. ' + reason);
      L28:  });
@gianlazz
Copy link
Author

I suspect I'm probably being a total noob and just missing some assumed knowledge since I followed along with the instructions just fine until reaching this point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant