Skip to content

Issues with importing interfaces created with export interface in Angular and TypeScript 3.9.6 #18170

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

Closed
stiezinger opened this issue Jul 7, 2020 · 2 comments · Fixed by #18478

Comments

@stiezinger
Copy link

Description

Recently I switched from Angular 9 to 10. On a new project I have issues to import interfaces automatically. For example I want to import this interface to my app.component.ts:


export interface TestInterface {
    string: name;
}

It is located in src/app/testInterface.ts. When i try to import it in my app.component.ts:


test: testInterface;

I am using VSC and IntelliSense is not showing me the option to autoimport/import the interface anymore. When i press Ctrl+. for Quick Fix I receive the message: No code actions available. In Angular 9 with Typescript 3.8.3 everything works fine, IntelliSense shows me the autoimport option or I can import the interface with Ctrl+. Key Binding. If I manually add the import it works:


import { testInterface } from 'src/app/testInterface';

🔬 Reproduction

To reproduce this issue try to install the latest angular/cli (at the moment of writing v10.0.1):


npm i @angular/[email protected] -g

Then create a new project:


ng new

Name it as you wish, I have enabled routing and choosen CSS for stylesheets.

When you install Angular 9 and create an project:


npm i @angular/[email protected] -g

ng new

Everything works as it should

🌍 Environment

My Environment is:


    _                      _                 ____ _     ___
   / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
  / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
 / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
/_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/
    

Angular CLI: 10.0.1
Node: 12.18.0
OS: win32 x64

Angular: 10.0.2
... animations, common, compiler, compiler-cli, core, forms
... localize, platform-browser, platform-browser-dynamic, router
Ivy Workspace: Yes

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.1000.1
@angular-devkit/build-angular     0.1000.1
@angular-devkit/build-optimizer   0.1000.1
@angular-devkit/build-webpack     0.1000.1
@angular-devkit/core              10.0.1
@angular-devkit/schematics        10.0.1
@angular/cdk                      10.0.1
@angular/cli                      10.0.1
@angular/material                 10.0.1
@ngtools/webpack                  10.0.1
@schematics/angular               10.0.1
@schematics/update                0.1000.1
rxjs                              6.5.5
typescript                        3.9.6
webpack                           4.43.0

Visual Studio Code Version 1.46.1
@alan-agius4 alan-agius4 self-assigned this Jul 7, 2020
@ngbot ngbot bot modified the milestone: needsTriage Jul 7, 2020
@alan-agius4 alan-agius4 added freq1: low Only reported by a handful of users who observe it rarely freq3: high type: bug/fix and removed freq1: low Only reported by a handful of users who observe it rarely labels Jul 7, 2020
@ngbot ngbot bot modified the milestones: needsTriage, Backlog Jul 7, 2020
@alan-agius4
Copy link
Collaborator

alan-agius4 commented Jul 7, 2020

Related to #18040 and microsoft/TypeScript#39370

filipesilva pushed a commit that referenced this issue Aug 12, 2020
…jects

Following the issues highlighted in https://docs.google.com/document/d/1eB6cGCG_2ircfS5GzpDC9dBgikeYYcMxghVH5sDESHw/edit?usp=sharing and discussions held with the TypeScript team. The best course of action is to rollback this feature.

In future, it is not excluded that solution style tsconfigs are re-introduced..

Closes #18040 and closes #18170
filipesilva pushed a commit that referenced this issue Aug 12, 2020
…onfig

Following the issues highlighted in https://docs.google.com/document/d/1eB6cGCG_2ircfS5GzpDC9dBgikeYYcMxghVH5sDESHw/edit?usp=sharing and discussions held with the TypeScript team. Together with the TypeScript team it was decided that the best course of action is to rollback this feature.

In future, it is not excluded that solution style tsconfigs are re-introduced.

Closes #18040, closes #18130 and closes #18170
@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 12, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants