Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AoT compilation returns error #4

Closed
Hehohehoheho opened this issue Mar 21, 2017 · 18 comments
Closed

AoT compilation returns error #4

Hehohehoheho opened this issue Mar 21, 2017 · 18 comments
Assignees
Labels
Projects

Comments

@Hehohehoheho
Copy link

When I try compiling my project with AoT, it returns the following error:

 Error in bail mode: [at-loader] compiled\node_modules\jw-bootstrap-switch-ng2\src\directive.ngfactory.ts:246:59
TS2339: Property 'subscribe' does not exist on type 'boolean'.

Any idea on how I can fix this?

@JulioWar
Copy link
Owner

Hello @Lucasvo1.
I guess you're using angular-cli, What version are you using?

@rihardsgladisevs
Copy link

@angular/cli: 1.0.0
node: 6.10.0
os: win32 x64

Have the same issue:

ERROR in C:/projects/ws/src/main/webapp/src/$$_gendir/node_modules/jw-bootstrap-switch-ng2/src/directive.ngfactory.ts (246,59): Property 'subscribe' does not exist on type 'boolean'.
C:/projects/ws/src/main/webapp/src/$$_gendir/node_modules/jw-bootstrap-switch-ng2/src/directive.ngfactory.ts (420,45): Property '_disabled' is private and only accessible within class 'JWBootstrapSwitchDirective'.

@JulioWar JulioWar added the bug label Mar 24, 2017
@JulioWar
Copy link
Owner

Thanks @rihardsgladisevs
I will review it as soon as possible.

@JulioWar JulioWar self-assigned this Mar 24, 2017
@JulioWar JulioWar added this to Pending in Mantainence Mar 24, 2017
@JulioWar JulioWar moved this from Pending to On Progress in Mantainence Mar 26, 2017
@JulioWar
Copy link
Owner

Hello Guys @rihardsgladisevs @Lucasvo1

I check the code I made some changes. please update the npm package and let me know if it works.
I will be in touch.

@Hehohehoheho
Copy link
Author

Hi @JulioWar, I am getting the same error

[at-loader] Checking finished with 1 errors
Error in bail mode: [at-loader] compiled\node_modules\jw-bootstrap-switch-ng2\src\directive.ngfactory.ts:246:59
TS2339: Property 'subscribe' does not exist on type 'boolean'.

@JulioWar
Copy link
Owner

JulioWar commented Mar 27, 2017

@Lucasvo1 I'm not getting that specific error.

Can you share the code of how you are initializing the switch? and What specific command you are using to compile with AoT?

I will try to replicate it.

@rihardsgladisevs
Copy link

H @JulioWar , I am getting the same error:

ERROR in C:/projects/ws/src/main/webapp/src/$$_gendir/node_modules/jw-bootstrap-switch-ng2/src/directive.ngfactory.ts (246,59): Property 'subscribe' does not exist on type 'boolean'

I call ng build --prod --aot for the build

@Hehohehoheho
Copy link
Author

Hehohehoheho commented Mar 28, 2017

I am using the same command as the one posted by @rihardsgladisevs

@JulioWar
Copy link
Owner

Sorry Guys, I try to reproduce the error but nothing happen.

Please check this repository and maybe you can find something that I'm missing.

You can try to use the command build or serve within the repository.

@Hehohehoheho
Copy link
Author

Hehohehoheho commented Mar 29, 2017

Could it have something to do with the get and set value?: https://github.com/JulioWar/jw-bootstrap-switch-ng2/blob/master/src/directive.ts#L409

@rihardsgladisevs
Copy link

rihardsgladisevs commented Mar 30, 2017

@Lucasvo1 @JulioWar, may be we use different version of TypeScript or Angular, personally I use:

"dependencies": {
    "@angular/common": "2.4.10",
    "@angular/compiler": "2.4.10",
    "@angular/core": "2.4.10",
    "@angular/forms": "2.4.10",
    "@angular/http": "2.4.10",
    "@angular/platform-browser": "2.4.10",
    "@angular/platform-browser-dynamic": "2.4.10",
    "@angular/router": "3.4.10",
    "core-js": "^2.4.1",
    "rxjs": "^5.1.0",
    "zone.js": "^0.7.6",
    "bootstrap": "3.3.7",
    "ng2-bootstrap": "1.4.2",
    "angular2-grid": "2.0.2",
    "jw-bootstrap-switch-ng2": "0.0.7",
    "bootstrap-switch": "^3.3.4"
  },
  "devDependencies": {
    "@angular/cli": "^1.0.0",
    "@angular/compiler-cli": "2.4.10",
    "@types/core-js": "0.9.37",
    "@types/jasmine": "2.5.38",
    "@types/node": "~6.0.60",
    "codelyzer": "~2.0.0",
    "cpr": "2.0.2",
    "jasmine-core": "~2.5.2",
    "jasmine-spec-reporter": "~3.2.0",
    "karma": "~1.4.1",
    "karma-chrome-launcher": "~2.0.0",
    "karma-cli": "^1.0.1",
    "karma-coverage-istanbul-reporter": "^0.2.0",
    "karma-jasmine": "^1.1.0",
    "karma-jasmine-html-reporter": "^0.2.2",
    "protractor": "~5.1.0",
    "reflect-metadata": "0.1.10",
    "ts-node": "~2.0.0",
    "tslint": "~4.4.2",
    "typescript": "~2.0.0"
  }

@JulioWar
Copy link
Owner

JulioWar commented Apr 2, 2017

@rihardsgladisevs, can you check the version of the library, the last release is "0.0.8".

It would be very helpful if you could make a repository where you can only isolate what corresponds to this library.

@FelipeCorso
Copy link

Hi @JulioWar , I am getting the same error:

$ ng build --target=production --environment=prod                                                                                  
Hash: 4a418307ced22a5d1316                                                                                                         
Time: 32015ms                                                                                                                      
chunk    {0} polyfills.26c1302608fdd9e5aa41.bundle.js (polyfills) 232 kB {5} [initial] [rendered]                                  
chunk    {1} main.f599f8eaa8f7a9d755f0.bundle.js (main) 463 kB {4} [initial] [rendered]                                            
chunk    {2} scripts.16c98b08d19fe806811e.bundle.js (scripts) 38.8 kB {5} [initial] [rendered]                                     
chunk    {3} styles.84af3b2310f56ccbd29d.bundle.css (styles) 175 bytes {5} [initial] [rendered]                                    
chunk    {4} vendor.d01d0287b5c9236e4538.bundle.js (vendor) 1.5 MB [initial] [rendered]                                            
chunk    {5} inline.a8f2839c95b9093d1bc1.bundle.js (inline) 0 bytes [entry] [rendered]                                             
                                                                                                                                   
ERROR in C:/my-project/src/$$_gendir/node_modules/jw-bootstrap-switch-ng2/src/directive.ngfactory.ts (246,59): Property 'subscribe' does not exist on type 'boolean'.                                                    

@JulioWar
Copy link
Owner

Hello @FelipeCorso
What is your version for nodejs, angular and this library ?
Can you share some of your code of your component where you are using this library ?

@FelipeCorso
Copy link

FelipeCorso commented Apr 28, 2017 via email

@FelipeCorso
Copy link

Hello @JulioWar
I simulated the problem, and here is the repository
https://github.com/FelipeCorso/jw-bootstrap-switch-ng2/tree/master/switch-project
You need install the angular-cli, I followed this tutorial
https://scotch.io/tutorials/use-the-angular-cli-for-faster-angular-2-projects
Then execute
npm install
ng build -prod

@JulioWar
Copy link
Owner

JulioWar commented May 9, 2017

Thanks @FelipeCorso.

I will review this repository as soon as possible.

@JulioWar
Copy link
Owner

Hey Guys, sorry for the delay, but I was trying to figure it out what was wrong in my code.
Thanks to the StackOverflow community 😄.

I published the version 0.0.9 on npm.

Please let me know if it is resolved.

@JulioWar JulioWar moved this from On Progress to Completed in Mantainence May 16, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Mantainence
Completed
Development

No branches or pull requests

4 participants