atom-typescript icon indicating copy to clipboard operation
atom-typescript copied to clipboard

Autocomplete not working when starting Atom without sudo

Open nikhildev opened this issue 10 years ago • 7 comments

Hi,

I noticed this thread https://github.com/TypeStrong/atom-typescript/issues/549 was discussed earlier as well.

I think the issue still persists. Autocomplete and format was working totally fine for me, until recently. I removed all my plugins except nuclide. Still no go.

However, if I run Atom from the CLI with sudo, things work perfectly fine. Here is a snippet from the console when I try autocomplete without atom started with sudo

PARENT ERR: no child when you tried to send : errorsForFile
/Users/nikhildev/.atom/packages/atom-typescript/dist/worker/lib/workerLib.js:183 CHILD ERR STDERR: FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - process out of memory

/Users/nikhildev/.atom/packages/atom-typescript/dist/worker/lib/workerLib.js:196 ts worker restarting. Don't know why it stopped with code: null

What might I be missing here?

Thanks

nikhildev avatar May 18 '16 07:05 nikhildev

just for more, here is my tsconfig

{
  "compileOnSave": false,
  "compilerOptions": {
    "declaration": false,
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "mapRoot": "",
    "module": "commonjs",
    "moduleResolution": "node",
    "noEmitOnError": true,
    "noImplicitAny": false,
    "outDir": "../dist/",
    "removeComments": true,
    "rootDir": ".",
    "sourceMap": true,
    "target": "es5",
    "inlineSources": true
  },

  "files": [
    "main.ts",
    "typings.d.ts"
  ]
}

Added to this, I have a whole lotta Pending requests piling up whenever I try to type. These are like updateText getProjectFileDetails errorsForFile editText etc

nikhildev avatar May 18 '16 08:05 nikhildev

I'm getting very similar errors, and I can't figure out quite what the problem is. Starting a new project and adding a tsconfig I'm getting no issues to start with, but on all my (medium to largeish) projects I seem to get this error. Running in sudo doesn't help either.

Also, atom seems to be using 100% CPU time according to top.

Any ideas as to how I would begin debugging the issue?

Maistho avatar May 26 '16 14:05 Maistho

So when installing a starter project using angular-cli

ng new testproj
cd testproj
atom .

I can reproduce the issue every time. There is a repo which should reproduce the issue. https://github.com/Maistho/atom-typescript-error

git clone https://github.com/Maistho/atom-typescript-error
cd atom-typescript-error
npm install
atom .

Just try editing the TestprojAppComponent (adding a constructor or something) and the issue will arise.

I turned off all other (community) atom packages, and tested this on windows and linux.

It seems the issue is some kind of memory leak / infinite loop, since my CPU and memory usage rises until I'm out of memory, and then it restarts again and again until I close atom.

Maistho avatar May 26 '16 14:05 Maistho

Seems like it might be the same issue as https://github.com/TypeStrong/atom-typescript/issues/332 ?

Maistho avatar May 26 '16 14:05 Maistho

@Maistho Well, I got around the problem using some of the suggested workarounds.

Firstly

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

And then I specified

"atom": {
  "rewriteTsConfig": true
}

This made sure all my source code is covered and Atom does'nt go hunting. My tsconfig.json is in my /src folder, so I don't need to exclude any dir here

nikhildev avatar May 27 '16 04:05 nikhildev

Same here. This shouldn't be an issue to start with, since I included all the files I wanted to look at in my files array from the beginning. If look filesGlob is present, the behaviour should be to just use the files in the files array

Maistho avatar May 27 '16 08:05 Maistho

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

github-actions[bot] avatar Dec 31 '19 00:12 github-actions[bot]