error TS2300: Duplicate identifier when adding PrimeUI

UI Components for Angular
Post Reply
ladvishal1985
Posts: 1
Joined: 19 Feb 2016, 10:24

19 Feb 2016, 10:55

Hi,
I am trying to integrate PrimeNG with my Angular2 application. When I add I get the below errors when I run TSC :
project/node_modules/angular2/manual_typings/globals-es6.d.ts(18,3): error TS2300: Duplicate identifier 'Object'.
project/node_modules/angular2/manual_typings/globals-es6.d.ts(19,3): error TS2300: Duplicate identifier 'Array'.
project/node_modules/angular2/manual_typings/globals-es6.d.ts(20,3): error TS2300: Duplicate identifier 'Map'.
project/node_modules/angular2/manual_typings/globals-es6.d.ts(21,3): error TS2300: Duplicate identifier 'Set'.
project/node_modules/angular2/manual_typings/globals-es6.d.ts(22,3): error TS2300: Duplicate identifier 'Date'.
project/node_modules/angular2/manual_typings/globals-es6.d.ts(23,3): error TS2300: Duplicate identifier 'RegExp'.
project/node_modules/angular2/manual_typings/globals-es6.d.ts(24,3): error TS2300: Duplicate identifier 'JSON'.
project/node_modules/angular2/manual_typings/globals-es6.d.ts(25,3): error TS2300: Duplicate identifier 'Math'.
project/node_modules/angular2/manual_typings/globals-es6.d.ts(27,3): error TS2300: Duplicate identifier 'Reflect'.
project/node_modules/angular2/manual_typings/globals-es6.d.ts(28,3): error TS2300: Duplicate identifier 'zone'.
project/node_modules/angular2/manual_typings/globals-es6.d.ts(29,3): error TS2300: Duplicate identifier 'getAngularTestability'
...
...
Below is my package.json file:
"dependencies": {
"angular2": "2.0.0-beta.3",
"es6-promise": "^3.0.2",
"es6-shim": "^0.33.3",
"ng2-material": "^0.2.2",
"primeng": "^0.3.0",
"reflect-metadata": "0.1.2",
"rxjs": "5.0.0-beta.0",
"systemjs": "0.19.6",
"zone.js": "0.5.11"
}

Not sure how I should resolve this.

cagatay.civici
Prime
Posts: 18158
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

19 Feb 2016, 13:19

Can you please try with beta2 to see if it works, latest ng releases change the way typings are handled.

cagatay.civici
Prime
Posts: 18158
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

19 Feb 2016, 18:19

Please also review quickstart sample;

https://github.com/primefaces/primeng-quickstart

cagatay.civici
Prime
Posts: 18158
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

19 Feb 2016, 21:22

I think you need to exlude node_modules, a sample tsconfig.json is;

Code: Select all

{
    "compilerOptions": {
        "target": "ES5",
        "module": "system",
        "moduleResolution": "node",
        "sourceMap": true,
        "emitDecoratorMetadata": true,
        "experimentalDecorators": true,
        "removeComments": false,
        "noImplicitAny": false,
        "declaration": true
    },
    "exclude": [
        "node_modules"
    ]
}
In beta7, according to angular2-quickstart sample at angular.io, it is;

Code: Select all

{
    "compilerOptions": {
        "target": "ES5",
        "module": "system",
        "moduleResolution": "node",
        "sourceMap": true,
        "emitDecoratorMetadata": true,
        "experimentalDecorators": true,
        "removeComments": false,
        "noImplicitAny": false,
        "declaration": true
    },
    "exclude": [
        "node_modules",
        "typings/main",
        "typings/main.d.ts"
    ]
}

Nerg
Posts: 6
Joined: 24 Feb 2016, 13:52

26 Feb 2016, 12:46

I have the same issue.

I try with the quickstart, and it's also not working. Here is what I've done:

git clone https://github.com/primefaces/primeng-quickstart.git
npm install
npm start

I have the exclude configured:

Code: Select all

"exclude": [
        "node_modules",
        "typings/main",
        "typings/main.d.ts"
    ]
No error until npm start, so it should be some config error or maybe it doesn't work on Mac OS X ?

Code: Select all

1] 16.02.26 11:37:34 304 GET /node_modules/primeng/components/spinner/spinner.js
[1] 16.02.26 11:37:34 304 GET /node_modules/primeng/components/tabview/tabpanel.js
[0] node_modules/primeng/components/accordion/accordion.d.ts(1,1): error TS6053: File '/Users/gren/WebstormProjects/primeng-quickstart/node_modules/primeng/typedefinition/primeui.d.ts' not found.
[0] node_modules/primeng/components/accordion/accordiontab.d.ts(1,1): error TS6053: File '/Users/gren/WebstormProjects/primeng-quickstart/node_modules/primeng/typedefinition/primeui.d.ts' not found.
[0] node_modules/primeng/components/button/button.d.ts(1,1): error TS6053: File '/Users/gren/WebstormProjects/primeng-quickstart/node_modules/primeng/typedefinition/primeui.d.ts' not found.
[0] node_modules/primeng/components/carousel/carousel.d.ts(1,1): error TS6053: File '/Users/gren/WebstormProjects/primeng-quickstart/node_modules/primeng/typedefinition/primeui.d.ts' not found.
[0] node_modules/primeng/components/chart/barchart/barchart.d.ts(1,1): error TS6053: File '/Users/gren/WebstormProjects/primeng-quickstart/node_modules/primeng/typedefinition/chart.d.ts' not found.
[0] node_modules/primeng/components/chart/barchart/barchart.d.ts(41,12): error TS2304: Cannot find name 'LinearChartData'.
[0] node_modules/primeng/components/chart/doughnutchart/doughnutchart.d.ts(1,1): error TS6053: File '/Users/gren/WebstormProjects/primeng-quickstart/node_modules/primeng/typedefinition/chart.d.ts' not found.
[0] node_modules/primeng/components/chart/doughnutchart/doughnutchart.d.ts(40,12): error TS2304: Cannot find name 'CircularChartData'.
[0] node_modules/primeng/components/chart/linechart/linechart.d.ts(1,1): error TS6053: File '/Users/gren/WebstormProjects/primeng-quickstart/node_modules/primeng/typedefinition/chart.d.ts' not found.
[0] node_modules/primeng/components/chart/linechart/linechart.d.ts(42,12): error TS2304: Cannot find name 'LinearChartData'.
[0] node_modules/primeng/components/chart/piechart/piechart.d.ts(1,1): error TS6053: File '/Users/gren/WebstormProjects/primeng-quickstart/node_modules/primeng/typedefinition/chart.d.ts' not found.
[0] node_modules/primeng/components/chart/piechart/piechart.d.ts(40,12): error TS2304: Cannot find name 'CircularChartData'.
[0] node_modules/primeng/components/chart/polarareachart/polarareachart.d.ts(1,1): error TS6053: File '/Users/gren/WebstormProjects/primeng-quickstart/node_modules/primeng/typedefinition/chart.d.ts' not found.
[0] node_modules/primeng/components/chart/polarareachart/polarareachart.d.ts(39,12): error TS2304: Cannot find name 'CircularChartData'.
[0] node_modules/primeng/components/chart/radarchart/radarchart.d.ts(1,1): error TS6053: File '/Users/gren/WebstormProjects/primeng-quickstart/node_modules/primeng/typedefinition/chart.d.ts' not found.
[0] node_modules/primeng/components/chart/radarchart/radarchart.d.ts(40,12): error TS2304: Cannot find name 'LinearChartData'.
[0] node_modules/primeng/components/checkbox/checkbox.d.ts(1,1): error TS6053: File '/Users/gren/WebstormProjects/primeng-quickstart/node_modules/primeng/typedefinition/primeui.d.ts' not found.
[0] node_modules/primeng/components/dialog/dialog.d.ts(1,1): error TS6053: File '/Users/gren/WebstormProjects/primeng-quickstart/node_modules/primeng/typedefinition/primeui.d.ts' not found.
[0] node_modules/primeng/components/fieldset/fieldset.d.ts(1,1): error TS6053: File '/Users/gren/WebstormProjects/primeng-quickstart/node_modules/primeng/typedefinition/primeui.d.ts' not found.
[0] node_modules/primeng/components/galleria/galleria.d.ts(1,1): error TS6053: File '/Users/gren/WebstormProjects/primeng-quickstart/node_modules/primeng/typedefinition/primeui.d.ts' not found.
[0] node_modules/primeng/components/growl/growl.d.ts(1,1): error TS6053: File '/Users/gren/WebstormProjects/primeng-quickstart/node_modules/primeng/typedefinition/primeui.d.ts' not found.
[0] node_modules/primeng/components/inputswitch/inputswitch.d.ts(1,1): error TS6053: File '/Users/gren/WebstormProjects/primeng-quickstart/node_modules/primeng/typedefinition/primeui.d.ts' not found.
[0] node_modules/primeng/components/inputtext/inputtext.d.ts(1,1): error TS6053: File '/Users/gren/WebstormProjects/primeng-quickstart/node_modules/primeng/typedefinition/primeui.d.ts' not found.
[0] node_modules/primeng/components/inputtextarea/inputtextarea.d.ts(1,1): error TS6053: File '/Users/gren/WebstormProjects/primeng-quickstart/node_modules/primeng/typedefinition/primeui.d.ts' not found.
[0] node_modules/primeng/components/listbox/listbox.d.ts(1,1): error TS6053: File '/Users/gren/WebstormProjects/primeng-quickstart/node_modules/primeng/typedefinition/primeui.d.ts' not found.
[0] node_modules/primeng/components/messages/messages.d.ts(1,1): error TS6053: File '/Users/gren/WebstormProjects/primeng-quickstart/node_modules/primeng/typedefinition/primeui.d.ts' not found.
[0] node_modules/primeng/components/panel/panel.d.ts(1,1): error TS6053: File '/Users/gren/WebstormProjects/primeng-quickstart/node_modules/primeng/typedefinition/primeui.d.ts' not found.
[0] node_modules/primeng/components/password/password.d.ts(1,1): error TS6053: File '/Users/gren/WebstormProjects/primeng-quickstart/node_modules/primeng/typedefinition/primeui.d.ts' not found.
[0] node_modules/primeng/components/radiobutton/radiobutton.d.ts(1,1): error TS6053: File '/Users/gren/WebstormProjects/primeng-quickstart/node_modules/primeng/typedefinition/primeui.d.ts' not found.
[0] node_modules/primeng/components/rating/rating.d.ts(1,1): error TS6053: File '/Users/gren/WebstormProjects/primeng-quickstart/node_modules/primeng/typedefinition/primeui.d.ts' not found.
[0] node_modules/primeng/components/selectbutton/selectbutton.d.ts(1,1): error TS6053: File '/Users/gren/WebstormProjects/primeng-quickstart/node_modules/primeng/typedefinition/primeui.d.ts' not found.
[0] node_modules/primeng/components/spinner/spinner.d.ts(1,1): error TS6053: File '/Users/gren/WebstormProjects/primeng-quickstart/node_modules/primeng/typedefinition/primeui.d.ts' not found.
[0] node_modules/primeng/components/tabview/tabpanel.d.ts(1,1): error TS6053: File '/Users/gren/WebstormProjects/primeng-quickstart/node_modules/primeng/typedefinition/primeui.d.ts' not found.
[0] node_modules/primeng/components/tabview/tabview.d.ts(1,1): error TS6053: File '/Users/gren/WebstormProjects/primeng-quickstart/node_modules/primeng/typedefinition/primeui.d.ts' not found.
[0] node_modules/primeng/components/togglebutton/togglebutton.d.ts(1,1): error TS6053: File '/Users/gren/WebstormProjects/primeng-quickstart/node_modules/primeng/typedefinition/primeui.d.ts' not found.
[0] node_modules/primeng/node_modules/angular2/src/facade/promise.d.ts(1,10): error TS2661: Cannot re-export name that is not defined in the module.
[0] node_modules/primeng/node_modules/angular2/typings/es6-shim/es6-shim.d.ts(6,14): error TS2300: Duplicate identifier 'PropertyKey'.
[0] node_modules/primeng/node_modules/angular2/typings/es6-shim/es6-shim.d.ts(9,5): error TS2300: Duplicate identifier 'done'.
[0] node_modules/primeng/node_modules/angular2/typings/es6-shim/es6-shim.d.ts(10,5): error TS2300: Duplicate identifier 'value'.
[0] node_modules/primeng/node_modules/angular2/typings/es6-shim/es6-shim.d.ts(248,5): error TS2300: Duplicate identifier 'EPSILON'.
[0] node_modules/primeng/node_modules/angular2/typings/es6-shim/es6-shim.d.ts(283,5): error TS2300: Duplicate identifier 'MAX_SAFE_INTEGER'.
[0] node_modules/primeng/node_modules/angular2/typings/es6-shim/es6-shim.d.ts(290,5): error TS2300: Duplicate identifier 'MIN_SAFE_INTEGER'.
[0] node_modules/primeng/node_modules/angular2/typings/es6-shim/es6-shim.d.ts(346,5): error TS2300: Duplicate identifier 'flags'.
[0] node_modules/primeng/node_modules/angular2/typings/es6-shim/es6-shim.d.ts(498,5): error TS2300: Duplicate identifier 'prototype'.
[0] node_modules/primeng/node_modules/angular2/typings/es6-shim/es6-shim.d.ts(561,5): error TS2300: Duplicate identifier 'size'.
[0] node_modules/primeng/node_modules/angular2/typings/es6-shim/es6-shim.d.ts(570,5): error TS2300: Duplicate identifier 'prototype'.
[0] node_modules/primeng/node_modules/angular2/typings/es6-shim/es6-shim.d.ts(581,5): error TS2300: Duplicate identifier 'size'.
[0] node_modules/primeng/node_modules/angular2/typings/es6-shim/es6-shim.d.ts(590,5): error TS2300: Duplicate identifier 'prototype'.
[0] node_modules/primeng/node_modules/angular2/typings/es6-shim/es6-shim.d.ts(605,5): error TS2300: Duplicate identifier 'prototype'.
[0] node_modules/primeng/node_modules/angular2/typings/es6-shim/es6-shim.d.ts(619,5): error TS2300: Duplicate identifier 'prototype'.
[0] typings/browser/ambient/es6-shim/es6-shim.d.ts(8,14): error TS2300: Duplicate identifier 'PropertyKey'.
[0] typings/browser/ambient/es6-shim/es6-shim.d.ts(11,5): error TS2300: Duplicate identifier 'done'.
[0] typings/browser/ambient/es6-shim/es6-shim.d.ts(12,5): error TS2300: Duplicate identifier 'value'.
[0] typings/browser/ambient/es6-shim/es6-shim.d.ts(250,5): error TS2300: Duplicate identifier 'EPSILON'.
[0] typings/browser/ambient/es6-shim/es6-shim.d.ts(285,5): error TS2300: Duplicate identifier 'MAX_SAFE_INTEGER'.
[0] typings/browser/ambient/es6-shim/es6-shim.d.ts(292,5): error TS2300: Duplicate identifier 'MIN_SAFE_INTEGER'.
[0] typings/browser/ambient/es6-shim/es6-shim.d.ts(348,5): error TS2300: Duplicate identifier 'flags'.
[0] typings/browser/ambient/es6-shim/es6-shim.d.ts(500,5): error TS2300: Duplicate identifier 'prototype'.
[0] typings/browser/ambient/es6-shim/es6-shim.d.ts(563,5): error TS2300: Duplicate identifier 'size'.
[0] typings/browser/ambient/es6-shim/es6-shim.d.ts(572,5): error TS2300: Duplicate identifier 'prototype'.
[0] typings/browser/ambient/es6-shim/es6-shim.d.ts(583,5): error TS2300: Duplicate identifier 'size'.
[0] typings/browser/ambient/es6-shim/es6-shim.d.ts(592,5): error TS2300: Duplicate identifier 'prototype'.
[0] typings/browser/ambient/es6-shim/es6-shim.d.ts(607,5): error TS2300: Duplicate identifier 'prototype'.
[0] typings/browser/ambient/es6-shim/es6-shim.d.ts(621,5): error TS2300: Duplicate identifier 'prototype'.
[1] [BS] File changed: app/app.component.js

cagatay.civici
Prime
Posts: 18158
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

29 Feb 2016, 01:00

Please try again, we've updated the quick start.

Post Reply

Return to “PrimeNG”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 4 guests