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

A lot of Pending Requests #969

Closed
AndersonDev opened this issue Jun 4, 2016 · 12 comments
Closed

A lot of Pending Requests #969

AndersonDev opened this issue Jun 4, 2016 · 12 comments
Labels

Comments

@AndersonDev
Copy link

Hi. I am using Angular 2 and Webpack for developing an Atom with atom-typescript. On every save I have increasing of pending requests. I tried to find solution, however they are old...

image

Thanks!

@DNRN
Copy link

DNRN commented Jun 6, 2016

I have a similar issue. Please help us on this one, because working in Atom right now is a bit frustrating :)

@nikhildev
Copy link

Do you mind posting your tsconfig file?

@pstawinski
Copy link

I have same problem. My project is build on: https://github.com/preboot/angular2-webpack with almost no changes... So my tsconfig is:

{
  "compilerOptions": {
    "target": "ES5",
    "module": "commonjs",
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "sourceMap": true,
    "noEmitHelpers": true
  },
  "compileOnSave": false,
  "buildOnSave": false
}

@nikhildev
Copy link

I had the same issue. Basically, the plugin wasn't able to find my ts files and thats why the pending requests were getting queued up. I got around it by including

"filesGlob": [
      "**/*.ts"
    ],

and

"atom": {
    "rewriteTsconfig": true
  }

In my tsconfig. This will rewrite the tsconfig file by scanning through your application for .ts files. Also, make sure that the tsconfig is the root folder of your app src and does not have node_modules as any child.

@AndersonDev
Copy link
Author

@DNRN @nikhildev @pstawinski the solusion is very easy:

tsconfig.json

{
  "compilerOptions": {
    "target": "es5",
    "module": "commonjs",
    "moduleResolution": "node",
    "sourceMap": true,
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "removeComments": false,
    "noImplicitAny": false
  },
  "exclude": [
    "node_modules"
  ],
  "compileOnSave": false,
  "buildOnSave": false
}

We add:

"exclude": [
    "node_modules"
  ]

and compiler ignore the tone of aditional files.

@pstawinski
Copy link

Thank you!

@robyoder
Copy link

Excluding node_modules seemed to help briefly, but after a few seconds, I'm back with the same kind of errors:

screen shot 2016-07-18 at 6 45 19 pm

@robyoder
Copy link

robyoder commented Aug 5, 2016

Related issues: #968, #1037. There are several old related issues as well (#728, #760, #556, #349), but they seem to have been resolved at one point and now the problem is back. @basarat, any ideas?

Here are my latest errors:

screen shot 2016-08-05 at 1 40 34 pm

@robyoder
Copy link

robyoder commented Aug 5, 2016

So, another data point. I originally had tsconfig referencing files like this:

    "files": [
        "src/ts/main.ts",
        "typings/index.d.ts"
    ]

My main.ts file is the entry point and all the other files are referenced via imports. I thought that would be the best way, and I would avoid spending time compiling files that I wasn't currently referencing anywhere. If I change that to this, though, it seems to work fine:

    "filesGlob": [
        "src/ts/**/*.ts",
        "typings/index.d.ts"
    ]

This apparently lets TS build its index much faster and seems to be the recommended way. My question is, though, is my first way supposed to be supported?

@intellix
Copy link

intellix commented Sep 12, 2016

I also can't understand how there's such a large difference in performance between atom-typescript and VSCode. I wonder what VSCode is doing differently to make it work flawlessly with an angular-cli generated project.

I have a component like this:

import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';

@Component({
  selector: 'app-home',
  templateUrl: './home.component.html',
  styleUrls: ['./home.component.scss']
})
export class HomeComponent implements OnInit {

  constructor(private router: Router) { }

  ngOnInit() {
  }

  onLogin(user) {
    // this.router.navigate(['village']);
  }
}

If I open up the project in VSCode and go to add another import from @angular/router, I'm instantly given a list of available imports. If I go to the onLogin method and go to type this.router, I'm instantly given a list of the available methods I'm allowed to call (navigate etc).

If I try the same with atom-typescript, my autocompletes can take between 3seconds, 1 minute or sometimes they don't appear at all if I have errors in my code.

I'm using TS 2.0.2 and my tsconfig.json inside the root of the project:

{
  "compilerOptions": {
    "declaration": false,
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "lib": ["es6", "dom"],
    "mapRoot": "./",
    "module": "es6",
    "moduleResolution": "node",
    "outDir": "../dist/out-tsc",
    "sourceMap": true,
    "target": "es5",
    "typeRoots": [
      "../node_modules/@types"
    ]
  }
}

I wouldn't say it's anything to do with Webpack or Broccoli as both of those build-systems are not running at the moment.
Is there perhaps one large-issue created about this or any other bits of information?

@aderbas
Copy link

aderbas commented Nov 24, 2016

Any solution for this? I am having the same problem in a Anguar 2 project, for me Infinity Pending Requests freezes a lot number.

tsconfig.json

{
  "compilerOptions": {
    "declaration": false,
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "lib": ["es6", "dom"],
    "mapRoot": "./",
    "module": "es6",
    "moduleResolution": "node",
    "outDir": "../dist/out-tsc",
    "sourceMap": true,
    "target": "es5",
    "typeRoots": [
      "../node_modules/@types"
    ]
  },
  "exclude": [
    "node_modules"
  ]
}

@github-actions
Copy link

This issue has been marked as stale because it did not have any activity for the last 90 days or more. Remove the stale label or comment or this will be closed in 14 days

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants