facebook

Upgrade to Angular 4.0.1 breaks TSLint validation

  1. CodeMix & Angular IDE
  2.  > 
  3. Webclipse 1.x Help
Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #520491 Reply

    Fedor Losev
    Participant

    When upgrading packages from Angular 4.0.0 to 4.0.1 there are bunch of errors in Webclipse problems view:

    Cannot load rule "component-class-suffix". Internal error while loading the rule with project's TSLint 4.5.1: Cannot find module '@angular/compiler'.

    Linting and everything from angular-cli works just fine.

    Are there some special steps for AngularIDE to make it working?

    #520492 Reply

    Fedor Losev
    Participant

    I forgot to mention errors are “TSLint Configuration Problem” on Resource tslint.json

    #520498 Reply

    Fedor Losev
    Participant

    Adding “@angular/core”: “^4.0.0” to devDependencies in package.json seems to cure the problem but obviously this is not a fix we want to have in our configuration for too long.

    #520601 Reply

    support-piotr
    Participant

    Fedor,

    AngularIDE uses resources from node_modules to run TSLint. Please try refreshing that folder and/or restarting. How does your package.json looks like?

    #520645 Reply

    Fedor Losev
    Participant

    Note another problem on forums, right now I submitted a reply. Then clicked edit to fix some formatting, edited, submitted and the post just disappeared without any notice.

    #520648 Reply

    Fedor Losev
    Participant

    Hi, here is more detailed information:

    I tried everything, refresh/restart/close project/clean. Note, the error will not appear until Project/Clean after changing the package.json versions.

    It does happen with any project, including fresh new package.json generated by Create Angular Project wizard (or manual angular cli), after changing angular versions from 4.0.0 to 4.0.1. Note ng lint does work after change without a problem.

    1) Say, I’m using New->Angular Project wizard:

    Angular CLI version: Latest(1.0.0)
    Node.js version: Latest(7.9.0)
    NPM version: Latest (3.10.10)
    The following commands will be executed to create your project:
    npm install @angular/cli@1.0.0
    npm install --save-dev angular-ide
    ng init --name angcheck

    The project is created ok

    ng lint
    All files pass linting.
    ng build
    ok

    Project/Clean: no errors.

    Generated package.json:

    {
      "name": "testts",
      "version": "0.0.0",
      "license": "MIT",
      "scripts": {
        "ng": "ng",
        "start": "ng serve",
        "build": "ng build",
        "test": "ng test",
        "lint": "ng lint",
        "e2e": "ng e2e"
      },
      "private": true,
      "dependencies": {
        "@angular/common": "^4.0.0",
        "@angular/compiler": "^4.0.0",
        "@angular/core": "^4.0.0",
        "@angular/forms": "^4.0.0",
        "@angular/http": "^4.0.0",
        "@angular/platform-browser": "^4.0.0",
        "@angular/platform-browser-dynamic": "^4.0.0",
        "@angular/router": "^4.0.0",
        "core-js": "^2.4.1",
        "rxjs": "^5.1.0",
        "zone.js": "^0.8.4"
      },
      "devDependencies": {
        "@angular/cli": "1.0.0",
        "@angular/compiler-cli": "^4.0.0",
        "@types/jasmine": "2.5.38",
        "@types/node": "~6.0.60",
        "codelyzer": "~2.0.0",
        "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-jasmine": "~1.1.0",
        "karma-jasmine-html-reporter": "^0.2.2",
        "karma-coverage-istanbul-reporter": "^0.2.0",
        "protractor": "~5.1.0",
        "ts-node": "~2.0.0",
        "tslint": "~4.5.0",
        "typescript": "~2.2.0"
      }
    }
    

    Note, the actual @angular/core version currently installed is 4.0.3 and it causes no problem with ide:

    
    $ npm list @angular/core
    -- @angular/core@4.0.3
    $ npm list tslint
    -- tslint@4.5.1
    

    Problems view is empty.

    2) Now just change angular versions in package.json to 4.0.1 (or 4.0.2, 4.0.3, doesn’t matter):

    {
      "name": "angcheck",
      "version": "0.0.0",
      "license": "MIT",
      "scripts": {
        "ng": "ng",
        "start": "ng serve",
        "build": "ng build",
        "test": "ng test",
        "lint": "ng lint",
        "e2e": "ng e2e"
      },
      "private": true,
      "dependencies": {
        "@angular/common": "^4.0.1",
        "@angular/compiler": "^4.0.1",
        "@angular/core": "^4.0.1",
        "@angular/forms": "^4.0.1",
        "@angular/http": "^4.0.1",
        "@angular/platform-browser": "^4.0.1",
        "@angular/platform-browser-dynamic": "^4.0.1",
        "@angular/router": "^4.0.1",
        "core-js": "^2.4.1",
        "rxjs": "^5.1.0",
        "zone.js": "^0.8.4"
      },
      "devDependencies": {
        "@angular/cli": "1.0.0",
        "@angular/compiler-cli": "^4.0.1",
        "@types/jasmine": "2.5.38",
        "@types/node": "~6.0.60",
        "codelyzer": "~2.0.0",
        "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-jasmine": "~1.1.0",
        "karma-jasmine-html-reporter": "^0.2.2",
        "karma-coverage-istanbul-reporter": "^0.2.0",
        "protractor": "~5.1.0",
        "ts-node": "~2.0.0",
        "tslint": "~4.5.0",
        "typescript": "~2.2.0"
      }
    }
    

    No actual changes:

    
    npm install
    $ npm list @angular/core
    -- @angular/core@4.0.3
    $ npm list tslint
    -- tslint@4.5.1
    

    cli works fine as before (no reason not to)

    
    ng lint
    All files pass linting.
    

    Eclipse Project / Clean:
    Problems

    
    Description	Resource	Path	Location	Type
    Cannot load rule "component-class-suffix". Internal error while loading the rule with project's TSLint 4.5.1: Cannot find module '@angular/compiler'.	tslint.json	/angcheck	Unknown	TSLint Configuration Problem
    

    Now change just angular/core back to 4.0.0 and clean project
    "@angular/core": "^4.0.0",
    Problems: empty

    #520650 Reply

    support-piotr
    Participant

    Fedor,

    Thank you for detailed analysis. I will try to reproduce the issue and I’ll keep you posted about the progress. As far as disappearing post – it was accidentally marked as a spam by our anti-spam bot, we’re investigating as obviously it shouldn’t be marked as a spam.

    #520653 Reply

    Fedor Losev
    Participant

    Not sure how complex but I think it would also be reasonable to provide some notification that the post was marked as spam and show back the source to allow edit and correct.

    And most important it should not delete the original post (which was already published and marked as not a spam).

    Currently when this happens, user not only loses everything that was done in edit but also the original post content.

    #522970 Reply

    Fedor Losev
    Participant

    Hi, do you think it is something with my environment, or is it a reproducible bug? Is it Angular problem or WebClipse?

    I wonder why putting “@angular/core”: “^4.0.0” in devDependencies solves the problem, for how long will this hack hold. I use 4.1.0 now and there is already 4.1.1 out.

    #523030 Reply

    support-swapna
    Moderator

    Fedor,

    Sorry for the delay. The dev team will get back to you soon.
    Thank you for your patience.

    –Swapna
    MyEclipse Support

    #524724 Reply

    Brian Fernandes
    Moderator

    Fedor,

    We’ve put out a prerelease of the 2017 CI 6 release, which should address this problem. To get the pre-release build, please follow the instructions in this thread: https://www.genuitec.com/forums/topic/webclipse-angular-ide-prerelease-stream/

    I know you have several bugs that are fixed on the prerelease stream – if you could update and let us know whether the prerelease fixes them, that would help a great deal.

    #525174 Reply

    Fedor Losev
    Participant

    Seems fixed in pre-release.

Viewing 12 posts - 1 through 12 (of 12 total)
Reply To: Upgrade to Angular 4.0.1 breaks TSLint validation

You must be logged in to post in the forum log in