0

I was struggling with getting lodash to work and came across this. I followed the guidelines provided here but still keep getting the error below.

Error: (SystemJS) XHR error (404) loading https://localhost:44382/libs/@types/lodash(…)(anonymous function) @ (index):34ZoneDelegate.invoke @ zone.js:232Zone.run @ zone.js:114(anonymous function) @ zone.js:502ZoneDelegate.invokeTask @ zone.js:265Zone.runTask @ zone.js:154drainMicroTaskQueue @ zone.js:401ZoneTask.invoke @ zone.js:339

this is my tsconfig file

{
"compileOnSave": true,
"compilerOptions": {
"typeRoots": [
  "libs/@types/"
],
"types": ["lodash"],
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"watch": true,
"module": "commonjs",
"noEmitOnError": true,
"noImplicitAny": false,
"outDir": "../wwwroot/appScripts/",
"removeComments": false,
"sourceMap": true,
"target": "es6",
"moduleResolution": "node"
},
 "exclude": [
"node_modules",
"typings/index",
"typings/index.d.ts",
"typings/browser",
"typings/browser.d.ts"
]
}

enter image description here

Community
  • 1
  • 1
Tee-Jay
  • 736
  • 2
  • 9
  • 28

1 Answers1

0

It turns out the version of typescript I was using was not compatible with lodash. I switched from typescript 2.0.8 back to 2.0.3 and everything just fell in place. The version of lodash I am using is 4.16.6 and the @types/lodash version is 4.14.38

Tee-Jay
  • 736
  • 2
  • 9
  • 28