We are getting the error with angular-cli beta 18
Error: Uncaught (in promise): TypeError: __WEBPACK_IMPORTED_MODULE_6_lodash__.find is not a function
Lodash + Types were added to the package.json: -
"lodash": "4.14",
"@types/lodash": "4.14.38",
In the scripts section of angular-cli.json we have a reference to the module
"../node_modules/lodash/lodash.js",
We are importing lodash using: -
import * as _ from 'lodash';
The compiled scripts.bundle.js
has the lodash javascript included.
Is there anything I have forgotten about?
Thanks!
EDIT: Don't add to your angular-cli.json files scripts section. This is not needed!
You seem to have it right there, just to make sure, here are the steps with how i can reproduce it working on one of my projects:
ng serve
npm install lodash --save
and npm install @types/lodash --save-dev
import * as _ from 'lodash';
console.log(_.chunk(['a', 'b', 'c', 'd'], 2));
ng serve
again