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

JS Outdated / TS Emit failed

Open eskirk opened this issue 10 years ago • 11 comments

Every time I save a .ts file (even if there are no errors) atom will give me a little red pop-up flag indicating TS Emit failed. This is just one of the mildly infuriating things that I could totally live with, but would really love to disable. Any tips?

Thanks!

I'm on OSX 10.11.4 if that matters ¯_(ツ)_/¯

pix or it didn't happen screen shot 2016-07-15 at 5 01 56 pm

eskirk avatar Jul 15 '16 22:07 eskirk

I found a work around where I add

atom-notification.error {
  display: none;
}

to the Stylesheet, but I don't like to have to do that :/

eskirk avatar Jul 15 '16 23:07 eskirk

Since moving to Typescript 2.0 I've been seeing this as well. It still seems to update the file. If anyone wants to chime in with how to figure out what it's failing on I would be happy to debug.

tlong-dev avatar Jul 20 '16 21:07 tlong-dev

Same problem here. And disable "compileOnSave" is not a valid option for me. =/

aderbas avatar Jul 21 '16 19:07 aderbas

Hi, same issue on Ubuntu 16.04 Latest Atom, Typescript and Node. image

Olmer1st avatar Oct 16 '16 15:10 Olmer1st

I have got the same issue. Mytsconfig.json looks like

{
    "compilerOptions": {
        "module": "commonjs",
        "target": "es5",
        "noImplicitAny": false,
        "sourceMap": false,
        "outDir": "./dist",
        "noEmitOnError": true
    },
    "files":[
      "src/main.ts"
    ]
}

When I remove the option noEmitOnError or set it to false, everything works fine. Building (F6) the project with this setting on true says: "Build success", but doesn't do anything.

pahlers avatar Oct 21 '16 13:10 pahlers

Same issue, happens on save.

{
  "compilerOptions": {
      "target": "es6",
      "module": "commonjs",
      "moduleResolution": "node",
      "isolatedModules": false,
      "jsx": "react",
      "experimentalDecorators": true,
      "emitDecoratorMetadata": true,
      "declaration": false,
      "noImplicitAny": false,
      "noImplicitUseStrict": false,
      "removeComments": true,
      "noLib": false,
      "preserveConstEnums": true,
      "suppressImplicitAnyIndexErrors": true,
      "declaration": true,
      "rootDir": "./src",
      "outDir": "./lib",
      "declarationDir": "./lib"
  },
  "exclude": [
    "node_modules",
    "typings/browser",
    "typings/browser.d.ts"
  ],
  "compileOnSave": true,
  "buildOnSave": false,
  "atom": {
    "rewriteTsconfig": false
  }
}

Error is the exact same as anyone else.

I must add that the TypeScript compiler works normally with the tsc command.

nistath avatar Oct 22 '16 14:10 nistath

I have the same problem, but only when using declaration: true in tscconfig.json. And not always...sometime when I first open the project everything seems to work fine, then I do some changes (modify tscconfig.json, open generated file, ...) and bang! JS Outdated and TS emit error... As already reported tsc compilation works just fine.

Here my project where you can reproduce the issue (I hope ) : https://github.com/davideicardi/progress-logger-js/tree/5eafe4d76aa5177360ac7e75a83360c484618b3e

davideicardi avatar Nov 26 '16 23:11 davideicardi

having the same problem. Can bypass issue by setting "noEmitOnError": false but would rather not. Saving files seems to make Atom think there was an error (when there actually was not) and thus .ts file is not emitted. Can compile on command line with tsc just fine.

josemera avatar Nov 29 '16 01:11 josemera

Maybe I have found a solution, at least for my use case. Basically I have the following tsconfig:

{
    "compilerOptions": {
        ....
        "declaration": true,
        "outDir": "build"
    },
    "exclude": [
        "node_modules"
    ],
    "compileOnSave": true
}

Note that I have an outDir set to build but I have not added the build directory to the excluded array. So probably atom-typescript try to build also *.d.ts files in the build directory. Adding build in the exclude array solve my problems and I don't see any error (no JS Outdated / TS Emit failed).

{
    "compilerOptions": {
        ....
        "declaration": true,
        "outDir": "build"
    },
    "exclude": [
        "build",
        "node_modules"
    ],
    "compileOnSave": true
}

I suggest to also exclude *.d.ts files if you don't use an out directory.

davideicardi avatar Dec 20 '16 19:12 davideicardi

Same issue. But if I exclude the node_modules folder as suggested by @davideicardi above, then any types I have installed from npm, such as npm install @types/node are also ignored.

According to the typescript handbook:

The "exclude" property defaults to excluding the node_modules, bower_components, jspm_packages and <outDir> directories when not specified.

Is atom-typescript simply not respecting these defaults?

jbree avatar Feb 09 '17 02:02 jbree

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 29 '19 00:12 github-actions[bot]