Webpack error in console while building app.bundle.js - ionic serve

I have reference the third party libraries like lodash and cordova. While my application works fine without any issues. i am able to use all the lodash and cordova features, I see this error when i do ionic serve.

I was wondering, is a configuration i need to do to get rid of this errors.



Hi @mhartington , Do you have any suggestions for this issue?

Hey there, so this is with Typescript?

Basically those errors mean that typescript just doesn’t understand the code you’re using.

See http://mhartington.io/post/ionic2-external-libraries/

General idea is that you need to install type definition files for those libs, like Lodash.

As for the Camera errors, try using our new ionic-native lib.


npm install --save ionic-native

Then in your code you can do

import {Page} from 'ionic-angular';
import {Camera} from 'ionic-native';
  templateUrl: 'build/pages/home/home.html'
export class HomePage {
    Camera.getPicture(options).then((imageData) => {
      // imageData is either a base64 encoded string or a file URI
      // If it's base64:
      let base64Image = "data:image/jpeg;base64," + imageData;
    }, (err) => {