Closed rajesh-kanakabandi closed 7 years ago
Hi @rajesh-kanakabandi , Yes already knew that the AOT fails, is in my plans to make the library AOT compatible soon, in the coming weeks.
@tiberiuzuld thank you for the response.
Hi @rajesh-kanakabandi , Library v2.6.0 is now compatible with AOT. Let me know if you find any issues.
@tiberiuzuld the AOT build is causing these errors on the console(these seem to be introduced in version 2.5.0 when updated to use angular4).
is there any way to make this work with angular 2.x.x
160 "export 'Renderer2' (imported as 'import17') was not found in '@angular/core/index'
WARNING in ./src/$$_gendir/~/angular-gridster2/dist/gridsterItem.component.ngfactory.ts
79:193-211 "export 'Renderer2' (imported as 'import11') was not found in '@angular/core/index'
WARNING in ./src/$$_gendir/~/angular-gridster2/dist/gridster.component.ngfactory.ts
73:121-139 "export 'Renderer2' (imported as 'import10') was not found in '@angular/core/index'
WARNING in ./src/$$_gendir/~/angular-gridster2/dist/gridster.component.ngfactory.ts
113:229-247 "export 'Renderer2' (imported as 'import10') was not found in '@angular/core/index'
WARNING in ./src/$$_gendir/~/angular-gridster2/dist/gridsterPreview.component.ngfactory.ts
56:198-216 "export 'Renderer2' (imported as 'import10') was not fHash: a2bf79545518daf073fa
Time: 25703ms
when I load the page on a browser, I see this error.
SyntaxError {_nativeError: Error: Can't resolve all parameters for GridsterComponent: ([object Object], ?). at SyntaxError.…}
message
:
(...)
name
:
(...)
stack
:
(...)
_nativeError
:
Error: Can't resolve all parameters for GridsterComponent: ([object Object], ?). at SyntaxError.BaseError [as constructor] (https://rkanakab.dev.arincdirect.net/cabin-dashboard2/vendor.bundle.js:94582:27) [<root>] at new SyntaxError (https://rkanakab.dev.arincdirect.net/cabin-dashboard2/vendor.bundle.js:6787:16) [<root>] at CompileMetadataResolver._getDependenciesMetadata (https://rkanakab.dev.arincdirect.net/cabin-dashboard2/vendor.bundle.js:21682:31) [<root>] at CompileMetadataResolver._getTypeMetadata (https://rkanakab.dev.arincdirect.net/cabin-dashboard2/vendor.bundle.js:21557:26) [<root>] at CompileMetadataResolver.getNonNormalizedDirectiveMetadata (https://rkanakab.dev.arincdirect.net/cabin-dashboard2/vendor.bundle.js:21197:24) [<root>] at CompileMetadataResolver._loadDirectiveMetadata (https://rkanakab.dev.arincdirect.net/cabin-dashboard2/vendor.bundle.js:21073:23) [<root>] at https://rkanakab.dev.arincdirect.net/cabin-dashboard2/vendor.bundle.js:21274:54 [<root>] at Array.forEach (native) [<root>] at CompileMetadataResolver.loadNgModuleDirectiveAndPipeMetadata (https://rkanakab.dev.arincdirect.net/cabin-dashboard2/vendor.bundle.js:21273:41) [<root>] at https://rkanakab.dev.arincdirect.net/cabin-dashboard2/vendor.bundle.js:63131:58 [<root>] at Array.forEach (native) [<root>] at JitCompiler._loadModules (https://rkanakab.dev.arincdirect.net/cabin-dashboard2/vendor.bundle.js:63130:43) [<root>] at JitCompiler._compileModuleAndComponents (https://rkanakab.dev.arincdirect.net/cabin-dashboard2/vendor.bundle.js:63085:52) [<root>] at JitCompiler.compileModuleAsync (https://rkanakab.dev.arincdirect.net/cabin-dashboard2/vendor.bundle.js:63051:21) [<root>]
__proto__
:
BaseError
CompileMetadataResolver._reportError @ metadata_resolver.js:972
CompileMetadataResolver._getDependenciesMetadata @ metadata_resolver.js:784
CompileMetadataResolver._getTypeMetadata @ metadata_resolver.js:659
CompileMetadataResolver.getNonNormalizedDirectiveMetadata @ metadata_resolver.js:299
CompileMetadataResolver._loadDirectiveMetadata @ metadata_resolver.js:175
(anonymous) @ metadata_resolver.js:376
CompileMetadataResolver.loadNgModuleDirectiveAndPipeMetadata @ metadata_resolver.js:375
(anonymous) @ compiler.js:171
JitCompiler._loadModules @ compiler.js:170
JitCompiler._compileModuleAndComponents @ compiler.js:125
JitCompiler.compileModuleAsync @ compiler.js:91
PlatformRef_._bootstrapModuleWithZone @ application_ref.js:390
PlatformRef_.bootstrapModule @ application_ref.js:365
702 @ main.ts:12
__webpack_require__ @ bootstrap a2bf795…:52
1566 @ main.bundle.js:262
__webpack_require__ @ bootstrap a2bf795…:52
webpackJsonpCallback @ bootstrap a2bf795…:23
(anonymous) @ main.bundle.js:1
```
ng version information:
@angular/cli: 1.0.0-beta.32.3 [1.0.0-beta.26] node: 6.9.1 os: linux x64 @angular/common: 2.4.10 @angular/compiler: 2.4.10 @angular/core: 2.4.10 @angular/flex-layout: 2.0.0-rc.1 @angular/forms: 2.4.10 @angular/http: 2.4.10 @angular/material: 2.0.0-beta.2 @angular/platform-browser: 2.4.10 @angular/platform-browser-dynamic: 2.4.10 @angular/router: 3.4.10 @angular/compiler-cli: 2.4.10 @angular/cli: 1.0.0-beta.32.3
regards,
Rajesh.
Hi @rajesh-kanakabandi , Renderer2 is only available in angular4
The migration for a angular2 app to angular4 should be easy enough. If I downgrade to angular2 then the angular4 apps will have issues because Renderer (1) which is deprecated and functions differently. And with angular2 I will have issues with angular-cli and the demo app.
So I am sorry but you will have to upgrade your app to angular4 and angular-cli@1.0.0 to be able to use AOT.
ERROR in Error encountered resolving symbol values statically. Calling function 'require', function calls are not supported. Consider replacing the function or lambda with a reference to an exported function, resolving symbol GridsterComponent in /home/dashboard-ui/node_modules/angular-gridster2/dist/gridster.component.d.ts, resolving symbol GridsterComponent in /home/dashboard-ui/node_modules/angular-gridster2/dist/gridster.component.d.ts
ERROR in ./src/main.ts Module not found: Error: Can't resolve './$$_gendir/app/app.module.ngfactory' in '/home/dashboard-ui/src' @ ./src/main.ts 5:0-74 @ multi ./src/main.ts