fegyi001 / mangol

Maps created with Angular & OpenLayers using Material design
http://188.166.116.137/mangol/
98 stars 47 forks source link

Error encountered resolving symbol values statically whilst importing Mangol #14

Closed curtis-stokes closed 7 years ago

curtis-stokes commented 7 years ago

Hi there,

When attempting to add mangol to my projects ngmodule imorts i get an "Error encountered resolving symbol values statically whilst import Mangol"

This only happens when doing the ng module import, and just doing import { MangolModule } from 'mangol'; at the top has no issue running my application.

Running using angular cli and ng server

Package.json dependencies

"dependencies": { "@angular/animations": "^4.2.4", "@angular/common": "^4.2.4", "@angular/compiler": "^4.2.4", "@angular/core": "^4.2.4", "@angular/forms": "^4.2.4", "@angular/http": "^4.2.4", "@angular/platform-browser": "^4.2.4", "@angular/platform-browser-dynamic": "^4.2.4", "@angular/router": "^4.2.4", "bootstrap": "^3.3.7", "core-js": "^2.4.1", "d3-ng2-service": "^1.16.1", "mangol": "^0.4.3", "ng-bootstrap": "^1.6.3", "ngx-bootstrap": "^1.9.3", "rxjs": "^5.4.2", "zone.js": "^0.8.14" }

Output

...
Date: 2017-09-15T15:14:11.777Z                
Hash: e26aa810aacbd2de6b7f
Time: 3265ms
chunk {inline} inline.bundle.js, inline.bundle.js.map (inline) 5.83 kB [entry] [rendered]
chunk {main} main.bundle.js, main.bundle.js.map (main) 1.06 kB {vendor} [initial] [rendered]
chunk {polyfills} polyfills.bundle.js, polyfills.bundle.js.map (polyfills) 323 bytes {inline} [initial] [rendered]
chunk {styles} styles.bundle.js, styles.bundle.js.map (styles) 162 kB {inline} [initial] [rendered]
chunk {vendor} vendor.bundle.js, vendor.bundle.js.map (vendor) 338 kB [initial] [rendered]

ERROR in Error: Error encountered resolving symbol values statically. Function calls are not supported. Consider replacing the function or lambda with a reference to an exported function (position 194:50 in the original .ts file), resolving symbol NgModule in /repositories/saas_stack/test-online/node_modules/mangol/node_modules/@angular/core/core.d.ts, resolving symbol MangolModule in /repositories/saas_stack/test-online/node_modules/mangol/src/lib/modules/_index.ts, resolving symbol MangolModule in /repositories/saas_stack/test-online/node_modules/mangol/src/lib/modules/_index.ts
    at positionalError (/repositories/saas_stack/test-online/node_modules/@angular/compiler/bundles/compiler.umd.js:25104:35)
    at simplifyInContext (/repositories/saas_stack/test-online/node_modules/@angular/compiler/bundles/compiler.umd.js:24947:27)
    at StaticReflector.simplify (/repositories/saas_stack/test-online/node_modules/@angular/compiler/bundles/compiler.umd.js:24961:13)
    at StaticReflector.annotations (/repositories/saas_stack/test-online/node_modules/@angular/compiler/bundles/compiler.umd.js:24391:41)
    at _getNgModuleMetadata (/repositories/saas_stack/test-online/node_modules/@angular/compiler-cli/src/ngtools_impl.js:138:31)
    at _extractLazyRoutesFromStaticModule (/repositories/saas_stack/test-online/node_modules/@angular/compiler-cli/src/ngtools_impl.js:109:26)
    at /repositories/saas_stack/test-online/node_modules/@angular/compiler-cli/src/ngtools_impl.js:129:27
    at Array.reduce (native)
    at _extractLazyRoutesFromStaticModule (/repositories/saas_stack/test-online/node_modules/@angular/compiler-cli/src/ngtools_impl.js:128:10)
    at Object.listLazyRoutesOfModule (/repositories/saas_stack/test-online/node_modules/@angular/compiler-cli/src/ngtools_impl.js:53:22)
    at Function.NgTools_InternalApi_NG_2.listLazyRoutes (/repositories/saas_stack/test-online/node_modules/@angular/compiler-cli/src/ngtools_api.js:91:39)
    at AotPlugin._getLazyRoutesFromNgtools (/repositories/saas_stack/test-online/node_modules/@ngtools/webpack/src/plugin.js:207:44)
    at _donePromise.Promise.resolve.then.then.then.then.then (/repositories/saas_stack/test-online/node_modules/@ngtools/webpack/src/plugin.js:443:24)
    at process._tickCallback (internal/process/next_tick.js:109:7)

webpack: Failed to compile.

Unfortunately new to angular so this may be a dumb issue, if so i apologise in advance.

jcendal commented 7 years ago

The solution for this question is here #8