angular-datatables icon indicating copy to clipboard operation
angular-datatables copied to clipboard

Error encountered resolving symbol values statically

Open antoineabourjeilycme opened this issue 9 years ago • 32 comments

Using:

  • angular version: 2.4.1
  • jquery version: 3.1.1
  • datatables version: 1.10.13
  • angular-datatables version: 2.0.1

Console log: Error encountered resolving symbol values statically. Calling function 'makeDecorator', function calls are not supported. Consider replacing the function or lambda with a reference to an exported function, resolving symbol NgModule in /node_modules/angular-datatables/node_modules/@angular/core/src/metadata/ng_module.d.ts, resolving symbol NgModule in /node_modules/angular-datatables/node_modules/@angular/core/src/metadata.d.ts, resolving symbol NgModule in /node_modules/angular-datatables/node_modules/@angular/core/src/core.d.ts, resolving symbol NgModule in /node_modules/angular-datatables/node_modules/@angular/core/index.d.ts, resolving symbol DataTablesModule in /node_modules/angular-datatables/dist/angular-datatables.module.d.ts, resolving symbol DataTablesModule in /node_modules/angular-datatables/dist/angular-datatables.module.d.ts

https://github.com/angular/angular-cli/issues/3707

antoineabourjeilycme avatar Jan 04 '17 15:01 antoineabourjeilycme

Update When I used only ng build --dev without -aot I got "ERROR in DataTablesModule is not an NgModule"

antoineabourjeilycme avatar Jan 05 '17 08:01 antoineabourjeilycme

What's your angular-cli.json configuration? Can you show your Angular App code?

l-lin avatar Jan 10 '17 09:01 l-lin

{
  "project": {
    "version": "1.0.0-beta.24",
    "name": "----"
  },
  "apps": [
    {
      "root": "src",
      "outDir": "dist",
      "assets": [
        "assets",
        "favicon.ico"
      ],
      "index": "index.html",
      "main": "main.ts",
      "test": "test.ts",
      "tsconfig": "tsconfig.json",
      "prefix": "",
      "mobile": false,
      "styles": [
       ----
      ],
      "scripts": [
        "../node_modules/jquery/dist/jquery.js",
        "../node_modules/datatables.net/js/jquery.dataTables.js"
      ],
      "environments": {
        "source": "environments/environment.ts",
        "dev": "environments/environment.ts",
        "prod": "environments/environment.prod.ts"
      }
    }
  ],
  "addons": [],
  "packages": [],
  "e2e": {
    "protractor": {
      "config": "./protractor.conf.js"
    }
  },
  "test": {
    "karma": {
      "config": "./karma.conf.js"
    }
  },
  "defaults": {
    "styleExt": "sass",
    "prefixInterfaces": false,
    "inline": {
      "style": false,
      "template": false
    },
    "spec": {
      "class": false,
      "component": true,
      "directive": true,
      "module": false,
      "pipe": true,
      "service": true
    }
  }
}

antoineabourjeilycme avatar Jan 10 '17 15:01 antoineabourjeilycme

As mentionned in this comment, angular-datatables is compatible with angular-cli version 1.0.0-beta.21, newer versions are not certain. I will not really fix this until angular-cli release a stable version.

l-lin avatar Jan 22 '17 15:01 l-lin

@angular/cli is stable at v1.0.0 now and i'm getting this error

ERROR in Error encountered resolving symbol values statically. Calling function 'makeDecorator', function calls are not supported. Consider repla cing the function or lambda with a reference to an exported function, resolving symbol NgModule in /Users/mac/Documents/Projects/nodejs/fixershub /node_modules/angular-datatables/node_modules/@angular/core/src/metadata/ng_module.d.ts, resolving symbol NgModule in /Users/mac/Documents/Projec ts/nodejs/fixershub/node_modules/angular-datatables/node_modules/@angular/core/src/metadata.d.ts, resolving symbol NgModule in /Users/mac/Documen ts/Projects/nodejs/fixershub/node_modules/angular-datatables/node_modules/@angular/core/src/core.d.ts, resolving symbol NgModule in /Users/mac/Do cuments/Projects/nodejs/fixershub/node_modules/angular-datatables/node_modules/@angular/core/index.d.ts, resolving symbol DataTablesModule in /Us ers/mac/Documents/Projects/nodejs/fixershub/node_modules/angular-datatables/src/angular-datatables.module.d.ts, resolving symbol DataTablesModule in /Users/mac/Documents/Projects/nodejs/fixershub/node_modules/angular-datatables/src/angular-datatables.module.d.ts

toniton avatar Apr 13 '17 11:04 toniton

Are you using angular 4? If so, then angular-datatables is still not compatible with version 4+. Follow the issue #998 when it will be supported.

l-lin avatar Apr 16 '17 22:04 l-lin

Sorry to bring this problem up again, but with the latest angular-datatables (4.1.1) and the latest Angular Version (4.2.2) the problem still persists. Building for production throws the following slightly altered error:

Error encountered resolving symbol values statically. Calling function 'ɵmakeDecorator', function calls are not supported. Consider replacing the function or lambda with a reference to an exported function, resolving symbol NgModule in /Users/paulvanhemmen/site/web/node_modules/angular-datatables/node_modules/@angular/core/core.d.ts, resolving symbol DataTablesModule in /Users/paulvanhemmen/site/web/node_modules/angular-datatables/src/angular-datatables.module.d.ts, resolving symbol DataTablesModule in /Users/paulvanhemmen/site/web/node_modules/angular-datatables/src/angular-datatables.module.d.ts

Anything I can do about it? Thanx!

pvanhemmen avatar Jun 13 '17 11:06 pvanhemmen

As a follow up, I was able to fix this issue by using the following workaround, see comment here and here.

Just wondering if that's something completely out of range for the implementation the angular-datatables Module?

pvanhemmen avatar Jun 13 '17 11:06 pvanhemmen

Indeed. I'm checking.

l-lin avatar Jun 13 '17 13:06 l-lin

Mmmh I seem to reproduce the issue with Node version 8.0.0 and NPM version 5.0.0. However, with the previous version (Node 7.10.0 and NPM 4.2.0), I don't have any issue.

@pvanhemmen, what versions of Node and NPM are you using?

l-lin avatar Jun 13 '17 15:06 l-lin

Hey thanx for checking back.

On my dev machine I have

npm 4.2.0 nodejs v7.10.0

Nonetheless I get the same error on a different setup, where I have

npm 4.6.1 nodejs v6.10.2

Angular + CLI and angular-datatables are up to date:

angular/* 4.2.2 angular/cli 1.0.4 angular-datatables 4.1.1 typescript 2.3.2

Compiling settings are pretty straight forward as they are angular cli default values. If I can help with anything else, please let me know.

pvanhemmen avatar Jun 13 '17 20:06 pvanhemmen

I have the same issue here:

ERROR in Error encountered resolving symbol values statically. Calling function 'ɵmakeDecorator', function calls are not supported.

angular: 4.2.2 angular-datatables 4.1.1 typescript: 2.3.4

@angular/cli: 1.1.1
node: 8.1.0
os: linux x64
npm: 5.0.3

And i I discovered this issue in angular repository https://github.com/angular/angular/issues/15767

I think my project is specifically breaking because of the angular-datatables.module.d.ts

fernandoTorresan avatar Jun 14 '17 11:06 fernandoTorresan

@pvanhemmen Your workaround worked for me, thank you! Add into tsconfig.app.json

"compilerOptions": {
    "sourceMap": true,
    "declaration": false,
    "moduleResolution": "node",
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "target": "es5",
    "lib": [
      "es2016",
      "dom"
    ],
    "outDir": "../out-tsc/app",
    "module": "es2015",
    "baseUrl": "",
    "types": [],
      "paths": {
      "@angular/*": ["../node_modules/@angular/*"] 
    }
  }

where was added: "paths": { "@angular/*": ["../node_modules/@angular/*"]

fernandoTorresan avatar Jun 14 '17 15:06 fernandoTorresan

Thank you, you saved my life

minhthuan274 avatar Jun 16 '17 11:06 minhthuan274

Documentation added.

l-lin avatar Jun 18 '17 15:06 l-lin

don't know why after adding above code my issue is not resolved for temporary I deleted the node_modue folder inside the angular-datatable folder and its works fine

nileshyadav326 avatar Jun 18 '17 16:06 nileshyadav326

@nileshyadav326, what was inside the node_modules folder?

What are the versions of the Node and NPM?

l-lin avatar Jun 19 '17 08:06 l-lin

npm version 5.0.1 node version 7.10.0 the node_module (angular-datatable/node_module) folder contain below folders

  • @angular
  • rxjs
  • zone.js

nileshyadav326 avatar Jun 19 '17 10:06 nileshyadav326

Hello, does anyone know how to change the language?

jeremybv89 avatar Oct 18 '17 00:10 jeremybv89

Hello, anyone faced following issue?? notsup Unsupported platform for fsevents@https://registry.npmjs.org/fsevents/-/fsevents-1.1.2.tgz: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"}) node version : 8.9.4 npm version : 5.6.0 Please help me out

hirakagile avatar Feb 19 '18 12:02 hirakagile