Error encountered resolving symbol values statically
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
Update When I used only ng build --dev without -aot I got "ERROR in DataTablesModule is not an NgModule"
What's your angular-cli.json configuration? Can you show your Angular App code?
{
"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
}
}
}
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.
@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
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.
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!
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?
Indeed. I'm checking.
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?
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.
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
@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/*"]
Thank you, you saved my life
Documentation added.
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, what was inside the node_modules folder?
What are the versions of the Node and NPM?
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
Hello, does anyone know how to change the language?
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