Skip to content

Subsequent variable declarations error on typings.d.ts #5499

Closed

Description

@dave11mj

Bug Report or Feature Request (mark with an x)

  • bug report -> please search issues before submitting
  • feature request

Versions.

@angular/cli: 1.0.0-rc.2
node: 6.9.5
os: darwin x64
@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
@angular/cli: 1.0.0-rc.2
@angular/compiler-cli: 2.4.10

Repro steps.

  1. ng new test-typings
  2. cd test-typings/
  3. Open src/typings.d.ts using Atom with TypeStrong/atom-typescript package
  4. Notice error Subsequent variable declarations must have the same type. on line 2:13

The log given by the failure.

image

Desired functionality.

I would like to not see errors when using typings.d.ts

Mention any other details that might be useful.

Using Atom Version 1.15.0 and TypeStrong/atom-typescript 10.1.14

Activity

  1. added
    P1Impacts a large percentage of users; if a workaround exists it is partial or overly painful
    on Mar 18, 2017
  2. added this to the milestone on Mar 18, 2017
  3. filipesilva commented on Mar 18, 2017

    @filipesilva
    Contributor

    I can verify this also happens in VS Code.

    This happens because the editor tsconfig does include node typings, so when the editor reads typings.d.ts there's an error.

    ng build uses a tsconfig without node typings so it's fine.

    The approaches that you're trying in #5500 aren't going to work though... this probably needs a more sophisticated solution.

  4. dave11mj commented on Mar 18, 2017

    @dave11mj
    ContributorAuthor

    @filipesilva which package do you use on VS Code ? That way I can test if the proposed solution works on it.

    Also is there a specific reason you feel #5500 isn't working or is not the correct implementation ? It seems to be working on my editor and passing the test for #5193 along with the others so far.

  5. filipesilva commented on Mar 18, 2017

    @filipesilva
    Contributor

    VS Code does not need any plugin, it should work with TS out of the box.

    This is what I see there with your solution:
    image

  6. dave11mj commented on Mar 18, 2017

    @dave11mj
    ContributorAuthor

    Cool !! What package is that ? I wanted to test on VS Code but didn't know which package is similar to TypeStrong

    Edit:
    Dump question .. just realize you said "no plugins"

  7. filipesilva commented on Mar 18, 2017

    @filipesilva
    Contributor

    No package needed, just a vanilla install of VS Code 😄

  8. dave11mj commented on Mar 18, 2017

    @dave11mj
    ContributorAuthor

    Yeah ... Updated comment when I realized "plugin" meant package ... Overall I realized I was having same error as you on Atom when I tested the tested the fix on it .. I was being too reliant on the CLI tests. I updated the PR so it doesn't use module: any; but rather extends NodeModule .. So far is working on both editors, and hopefully passes all tests.

  9. filipesilva commented on Mar 18, 2017

    @filipesilva
    Contributor

    You know what, I think that's the right solution. I hadn't thought about how declaration merging would kick in and make this whole work. Great job fixing this!

  10. dave11mj commented on Mar 18, 2017

    @dave11mj
    ContributorAuthor

    No problem ! xD .. Thanks for the VS Code screenshot btw, I hadn't realize the first solution that actually passed all tests wasn't working even on my own text editor until you showed me that ~ lol

  11. angular-automatic-lock-bot commented on Sep 6, 2019

    @angular-automatic-lock-bot

    This issue has been automatically locked due to inactivity.
    Please file a new issue if you are encountering a similar or related problem.

    Read more about our automatic conversation locking policy.

    This action has been performed automatically by a bot.

  12. locked and limited conversation to collaborators on Sep 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1Impacts a large percentage of users; if a workaround exists it is partial or overly painfultype: bug/fix

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions