install problems

UI Components for Angular
Post Reply
mthor1979
Posts: 79
Joined: 03 Mar 2016, 07:26

03 Mar 2016, 07:31

I have installed like the index example, but I get these errors when I do a gulp build if I have am import{Growl} or anything I try to import

/Users/Administrator/WebstormProjects/Calltower_Master/NG_Userportal/_userportal/user-connect/user_connect/node_modules/primeng/components/breadcrumb/breadcrumb.d.ts(7,18): error TS2304: Cannot find name 'JQuery'.
/Users/Administrator/WebstormProjects/Calltower_Master/NG_Userportal/_userportal/user-connect/user_connect/node_modules/primeng/components/chart/barchart/barchart.d.ts(40,12): error TS2304: Cannot find name 'LinearChartData'.
/Users/Administrator/WebstormProjects/Calltower_Master/NG_Userportal/_userportal/user-connect/user_connect/node_modules/primeng/components/chart/doughnutchart/doughnutchart.d.ts(39,12): error TS2304: Cannot find name 'CircularChartData'.
/Users/Administrator/WebstormProjects/Calltower_Master/NG_Userportal/_userportal/user-connect/user_connect/node_modules/primeng/components/chart/linechart/linechart.d.ts(41,12): error TS2304: Cannot find name 'LinearChartData'.
/Users/Administrator/WebstormProjects/Calltower_Master/NG_Userportal/_userportal/user-connect/user_connect/node_modules/primeng/components/chart/piechart/piechart.d.ts(39,12): error TS2304: Cannot find name 'CircularChartData'.
/Users/Administrator/WebstormProjects/Calltower_Master/NG_Userportal/_userportal/user-connect/user_connect/node_modules/primeng/components/chart/polarareachart/polarareachart.d.ts(38,12): error TS2304: Cannot find name 'CircularChartData'.
/Users/Administrator/WebstormProjects/Calltower_Master/NG_Userportal/_userportal/user-connect/user_connect/node_modules/primeng/components/chart/radarchart/radarchart.d.ts(39,12): error TS2304: Cannot find name 'LinearChartData'.
/Users/Administrator/WebstormProjects/Calltower_Master/NG_Userportal/_userportal/user-connect/user_connect/node_modules/primeng/components/megamenu/megamenu.d.ts(9,18): error TS2304: Cannot find name 'JQuery'.
/Users/Administrator/WebstormProjects/Calltower_Master/NG_Userportal/_userportal/user-connect/user_connect/node_modules/primeng/components/menu/menu.d.ts(12,18): error TS2304: Cannot find name 'JQuery'.
/Users/Administrator/WebstormProjects/Calltower_Master/NG_Userportal/_userportal/user-connect/user_connect/node_modules/primeng/components/menubar/menubar.d.ts(8,18): error TS2304: Cannot find name 'JQuery'.
/Users/Administrator/WebstormProjects/Calltower_Master/NG_Userportal/_userportal/user-connect/user_connect/node_modules/primeng/components/panelmenu/panelmenu.d.ts(7,18): error TS2304: Cannot find name 'JQuery'.
/Users/Administrator/WebstormProjects/Calltower_Master/NG_Userportal/_userportal/user-connect/user_connect/node_modules/primeng/components/slidemenu/slidemenu.d.ts(13,18): error TS2304: Cannot find name 'JQuery'.
/Users/Administrator/WebstormProjects/Calltower_Master/NG_Userportal/_userportal/user-connect/user_connect/node_modules/primeng/components/tieredmenu/tieredmenu.d.ts(13,18): error TS2304: Cannot find name 'JQuery'.

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

03 Mar 2016, 13:09

Please include typings to your project as typescript seems to look under node_modules, finds our d.ts files which has transitive dependencies to other d.ts files.

Here is an example from our quickstart;

https://github.com/primefaces/primeng-q ... pings.json

Adding this fixes the issue. You need to do "npm install" or "typings install" after adding this.

Typings is a nice add-on to get d.ts files automatically.

https://www.npmjs.com/package/typings

If you don't have it, you can get it via "npm install typings --global".

mthor1979
Posts: 79
Joined: 03 Mar 2016, 07:26

03 Mar 2016, 15:38

thank you for your help, I now have the jquery error gone, but I am seeing the issues below when I do a gulp build now

/Users/Administrator/WebstormProjects/Calltower_Master/NG_Userportal/_userportal/user-connect/user_connect/node_modules/primeng/components/chart/barchart/barchart.d.ts(40,12): error TS2304: Cannot find name 'LinearChartData'.
/Users/Administrator/WebstormProjects/Calltower_Master/NG_Userportal/_userportal/user-connect/user_connect/node_modules/primeng/components/chart/doughnutchart/doughnutchart.d.ts(39,12): error TS2304: Cannot find name 'CircularChartData'.
/Users/Administrator/WebstormProjects/Calltower_Master/NG_Userportal/_userportal/user-connect/user_connect/node_modules/primeng/components/chart/linechart/linechart.d.ts(41,12): error TS2304: Cannot find name 'LinearChartData'.
/Users/Administrator/WebstormProjects/Calltower_Master/NG_Userportal/_userportal/user-connect/user_connect/node_modules/primeng/components/chart/piechart/piechart.d.ts(39,12): error TS2304: Cannot find name 'CircularChartData'.
/Users/Administrator/WebstormProjects/Calltower_Master/NG_Userportal/_userportal/user-connect/user_connect/node_modules/primeng/components/chart/polarareachart/polarareachart.d.ts(38,12): error TS2304: Cannot find name 'CircularChartData'.
/Users/Administrator/WebstormProjects/Calltower_Master/NG_Userportal/_userportal/user-connect/user_connect/node_modules/primeng/components/chart/radarchart/radarchart.d.ts(39,12): error TS2304: Cannot find name 'LinearChartData'.
src/main/components/main.ts(93,10): error TS2314: Generic type 'Array<T>' requires 1 type argument(s).
/Users/Administrator/WebstormProjects/Calltower_Master/NG_Userportal/_userportal/user-connect/user_connect/typings/browser/ambient/jquery/jquery.d.ts(3212,13): error TS2403: Subsequent variable declarations must have the same type. Variable '$' must be of type 'cssSelectorHelper', but here has type 'JQueryStatic'.



and if I try to run the application I get this below in the debugger..

angular2.js?1457011357165:23083 EXCEPTION: TypeError: jQuery(...).puigrowl is not a function in [msgs in MainCmp@0:9]BrowserDomAdapter.logError @ angular2.js?1457011357165:23083BrowserDomAdapter.logGroup @ angular2.js?1457011357165:23094ExceptionHandler.call @ angular2.js?1457011357165:1185(anonymous function) @ angular2.js?1457011357165:12591NgZone._notifyOnError @ angular2.js?1457011357165:13635collection_1.StringMapWrapper.merge.onError @ angular2.js?1457011357165:13539Zone.run @ angular2-polyfills.js?1457011357161:1247NgZone._notifyOnTurnDone @ angular2.js?1457011357165:13450(anonymous function) @ angular2.js?1457011357165:13565zoneBoundFn @ angular2-polyfills.js?1457011357161:1220lib$es6$promise$asap$$flush @ angular2-polyfills.js?1457011357161:262

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

03 Mar 2016, 16:03

You also need a chart.d.ts for the charts.js references. Note that as of 0.6, this should work without adding the typings.

https://github.com/primefaces/primeng-q ... pings.json

Also exclude main;

https://github.com/primefaces/primeng-q ... onfig.json

QuickStart will help here;

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

Can you post your index.html please? I think you are missing some resources.

Here is an example one;

https://github.com/primefaces/primeng-q ... index.html

mthor1979
Posts: 79
Joined: 03 Mar 2016, 07:26

03 Mar 2016, 22:35

thank you for helping, seems like I am getting closer, I now only have one error on my gulp build.dev

/typings/browser/ambient/jquery/jquery.d.ts(3212,13): error TS2403: Subsequent variable declarations must have the same type. Variable '$' must be of type 'cssSelectorHelper', but here has type 'JQueryStatic'.

here is my index.html

Code: Select all

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <title>User:Connect</title>
  <meta name="description" content="">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <!-- inject:css -->
  <link rel="stylesheet" href="/node_modules/ag-grid/dist/styles/ag-grid.css?1457037451155">
  <link rel="stylesheet" href="/node_modules/ag-grid/dist/styles/theme-fresh.css?1457037451155">
  <link rel="stylesheet" href="/node_modules/bootstrap/dist/css/bootstrap.min.css?1457037451155">
  <link rel="stylesheet" href="/dist/dev/assets/css/main.css?1457037451156">
  <link rel="stylesheet" href="/dist/dev/assets/css/font-awesome.min.css?1457037451161">
  <link rel="stylesheet" href="/dist/dev/assets/resources/primeui.css?1457037451161">
  <!-- endinject -->
</head>
<body>

  <app>Loading...</app>

  <script>
  // function.name (all IE)
  // Remove once https://github.com/angular/angular/issues/6501 is fixed.
  /*! @source http://stackoverflow.com/questions/6903762/function-name-not-supported-in-ie*/
  if (!Object.hasOwnProperty('name')) {
    Object.defineProperty(Function.prototype, 'name', {
      get: function() {
        var matches = this.toString().match(/^\s*function\s*(\S*)\s*\(/);
        var name = matches && matches.length > 1 ? matches[1] : "";
        // For better performance only parse once, and then cache the
        // result through a new accessor for repeated access.
        Object.defineProperty(this, 'name', {value: name});
        return name;
      }
    });
  }
  </script>
  
  <script>
  // Fixes undefined module function in SystemJS bundle
  function module() {}
  </script>

  <!-- shims:js -->
  <script src="/node_modules/systemjs/dist/system-polyfills.src.js?1457037451147"></script>
  <script src="/node_modules/reflect-metadata/Reflect.js?1457037451148"></script>
  <script src="/node_modules/es6-shim/es6-shim.js?1457037451148"></script>
  <script src="/node_modules/systemjs/dist/system.src.js?1457037451148"></script>
  <script src="/node_modules/angular2/es6/dev/src/testing/shims_for_IE.js?1457037451148"></script>
  <script src="/node_modules/angular2/bundles/angular2-polyfills.js?1457037451149"></script>
  <!-- endinject -->

  
  <script>System.config({"defaultJSExtensions":true,"paths":{"main":"/main","angular2/*":"/angular2/*","rxjs/*":"/rxjs/*","*":"/node_modules/*","moment":"/node_modules/ng2-bootstrap/node_modules/moment/moment"},"primeng":"/node_modules/primeng/primeng"})</script>
  

  <!-- libs:js -->
  <script src="/node_modules/rxjs/bundles/Rx.js?1457037451151"></script>
  <script src="/node_modules/angular2/bundles/angular2.js?1457037451151"></script>
  <script src="/node_modules/angular2/bundles/router.js?1457037451152"></script>
  <script src="/node_modules/angular2/bundles/http.js?1457037451152"></script>
  <script src="/node_modules/ag-grid-ng2/lib/agGridNg2.js?1457037451152"></script>
  <script src="/node_modules/ag-grid/dist/ag-grid.js?1457037451152"></script>
  <script src="/node_modules/jquery/dist/jquery.js?1457037451153"></script>
  <script src="/node_modules/jquery-ui/jquery-ui.js?1457037451153"></script>
  <script src="/node_modules/primeui/primeui.js?1457037451154"></script>
  <script src="/node_modules/primeng/primeng.js?1457037451154"></script>
  <!-- endinject -->

  <!-- inject:js -->
  <!-- endinject -->

  
  <script>
  System.import('main')
    .catch(function (e) {
      console.error(e,
        'Report this error at https://github.com/mgechev/angular2-seed/issues');
    });
  </script>
  

</body>
</html>


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

04 Mar 2016, 11:42

It is a known issue with angular protactor and jquery, this was supposed to be fixed in Angular2 beta2, which version do you have;

https://github.com/angular/angular/issues/4725

Two more links;

https://github.com/DefinitelyTyped/Defi ... ssues/2734
https://github.com/angular/angular/issues/5459

Are you using typings module by the way?

mthor1979
Posts: 79
Joined: 03 Mar 2016, 07:26

04 Mar 2016, 14:55

thank you for posting those links, I found those also after I posted this, I am using node_modules, dont think I am using modules if that is something different. I am using moment though

I am actually using beta "angular2": "2.0.0-beta.7",

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

04 Mar 2016, 15:19

Is it possible to see your code somewhere like a plunk?

Post Reply

Return to “PrimeNG”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 27 guests