asotog / squeezebox

Simple Angular 2 accordion component
19 stars 8 forks source link

Error during AOT compiling #8

Closed olehleskiv closed 7 years ago

olehleskiv commented 7 years ago

I am using squeezebox component inside my project based on Angular Starter and I have an error during AOT compiling

Error: Error at /projects/angular-test/compiled/node_modules/squeezebox/components/sb-item-body.ngfactory.ts:121:40: Property 'height' is private and only accessible within class 'SBItemBody'.
    at UserError.Error (native)
    at new UserError (/projects/tools/@angular/tsc-wrapped/src/tsc.ts:33:25)
    at check (/projects/tools/@angular/tsc-wrapped/src/tsc.ts:69:11)
    at Tsc.typeCheck (/projects/tools/@angular/tsc-wrapped/src/tsc.ts:152:5)
    at /projects/tools/@angular/tsc-wrapped/src/main.ts:68:11
    at process._tickCallback (internal/process/next_tick.js:103:7)
asotog commented 7 years ago

mm weird will check that later, can you please try the just published version 1.1.10 ?

olehleskiv commented 7 years ago

Thanks for such quick reply! Now I have got even more weird error

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 Injectable in /projects/angular-test/node_modules/squeezebox/node_modules/@angular/core/core.d.ts, 
resolving symbol ɵf in /projects/angular-test/node_modules/squeezebox/node_modules/@angular/core/core.d.ts, 
resolving symbol ɵf in /projects/angular-test/node_modules/squeezebox/node_modules/@angular/core/core.d.ts
    at Error (native)
    at syntaxError (/projects/angular-test/node_modules/@angular/compiler/bundles/compiler.umd.js:1513:34)
    at simplifyInContext (/projects/angular-test/node_modules/@angular/compiler/@angular/compiler.es5.js:23797:17)
    at StaticReflector.simplify (/projects/angular-test/node_modules/@angular/compiler/@angular/compiler.es5.js:23809:7)
    at StaticReflector.annotations (/projects/angular-test/node_modules/@angular/compiler/@angular/compiler.es5.js:23258:38)
    at NgModuleResolver.resolve (/projects/angular-test/node_modules/@angular/compiler/@angular/compiler.es5.js:13786:34)
    at CompileMetadataResolver.getNgModuleMetadata (/projects/angular-test/node_modules/@angular/compiler/@angular/compiler.es5.js:14371:58)
    at addNgModule (/projects/angular-test/node_modules/@angular/compiler/bundles/compiler.umd.js:22982:58)
    at /projects/angular-test/node_modules/@angular/compiler/bundles/compiler.umd.js:22993:14
    at Array.forEach (native)
    at _createNgModules (/projects/angular-test/node_modules/@angular/compiler/@angular/compiler.es5.js:22987:8)
    at analyzeNgModules (/projects/angular-test/node_modules/@angular/compiler/bundles/compiler.umd.js:22867:14)
    at analyzeAndValidateNgModules (/projects/angular-test/node_modules/@angular/compiler/@angular/compiler.es5.js:22872:19)
    at AotCompiler.compileAll (/projects/angular-test/node_modules/@angular/compiler/@angular/compiler.es5.js:22648:13)
    at CodeGenerator.codegen (/projects/angular-test/packages/compiler-cli/src/codegen.ts:41:10)
    at /projects/angular-test/node_modules/src/main.ts:20:84
    at Object.main (/projects/tools/@angular/tsc-wrapped/src/main.ts:116:12)
    at Object.runInternal (/projects/angular-test/node_modules/src/main.ts:25:10)
    at /projects/angular-test/node_modules/src/plugin.ts:64:21
    at process._tickCallback (internal/process/next_tick.js:103:7)
    at Module.runMain (module.js:606:11)
    at run (bootstrap_node.js:394:7)
    at startup (bootstrap_node.js:149:9)
    at bootstrap_node.js:509:3
asotog commented 7 years ago

which angular version are you running ?

olehleskiv commented 7 years ago

4.0.3

asotog commented 7 years ago

cool will do some test later today with angular cli

asotog commented 7 years ago

which starter kit you are using? i did a test with angular cli https://github.com/angular/angular-cli but not able to see the error when running with AOT ng serve --aot --target=production or building ng build --aot --target=production, seems running fine there

olehleskiv commented 7 years ago

I am using Angular Starter https://github.com/AngularClass/angular-starter

asotog commented 7 years ago

thanks will check that later today, might be some configuration differences between starter kit and angular cli tool

olehleskiv commented 7 years ago

Hi @asotog! Do you have any updates?

asotog commented 7 years ago

Took a look at starter kit, and was able to reproduce issue but not sure why the difference between angular cli (working fine) and this, need to check further, if you find something else please let me know or sent PR, will appreciate

glebmachine commented 7 years ago

@asotog I've got same error (Calling function 'ɵmakeDecorator', function calls are not supported) using angular-cli 1.0.0

Update1: Also tested with 1.0.4 version (latest)

asotog commented 7 years ago

can you please paste here your package.json ?

glebmachine commented 7 years ago

@asotog Hi!

I'm using https://github.com/asotog/squeezebox This package has @angular/core in dependencies section. That was the reason of dups of angular code with mismatched versions.

I have fixed it by moving all deps into devDeps and peerDeps: https://github.com/asotog/squeezebox/pull/9/commits/0119ed6cbbe15819c2356a40f6df0e962a0f0249

asotog commented 7 years ago

cool thanks so much, didn't see this ticket referenced to that commit, but already did merge and published package @olehleskiv can you please try @glebmachine 's fix

glebmachine commented 7 years ago

So, it's not, i'm forgot to mention commit here : ) You welcome!

olehleskiv commented 7 years ago

Cool! It solves my issue too. Thanks guys!