Closed AndersonDev closed 4 years ago
I have a similar issue. Please help us on this one, because working in Atom right now is a bit frustrating :)
Do you mind posting your tsconfig file?
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
}
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.
@DNRN @nikhildev @pstawinski the solusion is very easy:
{
"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.
Thank you!
Excluding node_modules seemed to help briefly, but after a few seconds, I'm back with the same kind of errors:
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:
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 import
s. 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?
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?
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"
]
}
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
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...
Thanks!