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

Cannot find name 'sensors'. #15

Open
anilkunchalaece opened this issue Feb 11, 2018 · 0 comments
Open

Cannot find name 'sensors'. #15

anilkunchalaece opened this issue Feb 11, 2018 · 0 comments

Comments

@anilkunchalaece
Copy link

anilkunchalaece commented Feb 11, 2018

Hi,
I tried the demo code for ionic 3 but i got "Cannot find name 'sensors " error.

This is my ionic info

   @ionic/cli-utils  : 1.19.0
    ionic (Ionic CLI) : 3.19.0

global packages:

    cordova (Cordova CLI) : 7.1.0 

local packages:

    @ionic/app-scripts : 3.1.8
    Cordova Platforms  : android 6.3.0
    Ionic Framework    : ionic-angular 3.9.2

System:

    Node : v6.11.2
    npm  : 3.10.10 
    OS   : Linux 4.8

and the error is

[23:34:29]  typescript: src/pages/sensor/sensor.ts, line: 30 
            Cannot find name 'sensors'. 

      L29:  console.log('get data')
      L30:  sensors.enableSensor("PROXIMITY")
      L31:  sensors.getState((values) => {

[23:34:29]  typescript: src/pages/sensor/sensor.ts, line: 31 
            Cannot find name 'sensors'. 

      L30:  sensors.enableSensor("PROXIMITY")
      L31:  sensors.getState((values) => {
      L32:    console.log(JSON.stringify(values))

Error: Failed to transpile program
    at BuildError.Error (native)

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