Duplicate identifier '_' in Lodash index.d.ts: 244: 12 Angular2 web package build

EDIT: see bottom

I searched a ton of articles on the issue of duplicate identifier, but did not find anything that could help me fix this problem. I have the following package.json:

"dependencies": { "@angular/common": "2.3.0", "@angular/compiler": "2.3.0", "@angular/core": "2.3.0", "@angular/forms": "2.3.0", "@angular/http": "2.3.0", "@angular/material": "^2.0.0-alpha.11-3", "@angular/platform-browser": "2.3.0", "@angular/platform-browser-dynamic": "2.3.0", "@angular/router": "3.3.0", "angular2-jwt": "^0.1.26", "angular2-modal": "^2.0.2", "bootstrap": "^3.3.7", "fs": "0.0.1-security", "gulp": "^3.9.1", "jquery": "^3.1.1", "reflect-metadata": "^0.1.3", "rxjs": "5.0.0-rc.4", "stripe": "^4.15.0", "web-animations-js": "^2.2.2", "zone.js": "^0.7.2" }, "devDependencies": { "@angularclass/hmr": "^1.0.1", "@angularclass/hmr-loader": "^3.0.2", "@types/es6-shim": "^0.31.32", "@types/jasmine": "^2.2.29", "@types/node": "^6.0.38", "@types/selenium-webdriver": "2.53.33", "angular2-router-loader": "^0.3.4", "angular2-template-loader": "^0.6.0", "autoprefixer": "^6.3.2", "awesome-typescript-loader": "^2.2.4", "codelyzer": "1.0.0-beta.3", "copy-webpack-plugin": "^4.0.0", "css-loader": "^0.25.0", "exports-loader": "^0.6.3", "extract-text-webpack-plugin": "^2.0.0-beta.4", "file-loader": "^0.9.0", "html-loader": "^0.4.0", "html-webpack-plugin": "^2.8.1", "imports-loader": "^0.7.0", "istanbul-instrumenter-loader": "^0.2.0", "jasmine-core": "^2.3.4", "jasmine-spec-reporter": "^2.4.0", "json-loader": "^0.5.3", "karma": "1.3.0", "karma-chrome-launcher": "^2.0.0", "karma-coverage": "^1.0.0", "karma-jasmine": "^1.0.2", "karma-mocha-reporter": "^2.0.3", "karma-remap-istanbul": "0.2.1", "karma-sourcemap-loader": "^0.3.7", "karma-webpack": "1.8.0", "node-sass": "^3.4.2", "null-loader": "0.1.1", "postcss-loader": "^1.1.0", "protractor": "^4.0.10", "raw-loader": "0.5.1", "remap-istanbul": "^0.6.4", "resolve-url": "^0.2.1", "resolve-url-loader": "^1.6.1", "rimraf": "^2.5.1", "sass-loader": "^4.0.2", "shelljs": "^0.7.0", "style-loader": "^0.13.1", "ts-helpers": "^1.1.1", "tslint": "^3.4.0", "tslint-loader": "^2.1.0", "typedoc": "^0.5.1", "typescript": "2.0.10", "url-loader": "^0.5.7", "webpack": "^2.1.0-beta.25", "webpack-dashboard": "^0.2.0", "webpack-dev-server": "2.1.0-beta.9" } } 

then inside my tsconfig.json i have

 { "compilerOptions": { "target": "es6", "lib": ["dom", "es5"], "typeRoots": [ "./node_modules/@types" ], "module": "commonjs", "moduleResolution": "node", "emitDecoratorMetadata": true, "experimentalDecorators": true, "sourceMap": true, "noEmitHelpers": true, "noImplicitAny": false }, "compileOnSave": false, "buildOnSave": false, "awesomeTypescriptLoaderOptions": { "forkChecker": true, "useWebpackText": true }, "exclude": [ "node_modules", "**/*.spec.ts", "dist" ] } 

But every time I try to start the webpack build, I get:

node_modules/@types/lodash/index.d.ts:244:12 Duplicate identifier '_'

So it seems that several of my packages interfere with each other? Does anyone know which ones? Thanks for any help

EDIT I found the cause of conflicting builds. I seem to have

node_modules/lodash and at the same time I have node_modules/@types/lodash , now how do I find which types of packages install lodash types?

+5
source share
1 answer

Adding "@types/lodash": "ts2.0", to package.json for me. https://github.com/driftyco/ionic-app-scripts/issues/700

Hope this helps. :)

+10
source

Source: https://habr.com/ru/post/1263897/


All Articles