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

TS emit failed with latest release

Open tomitrescak opened this issue 10 years ago • 28 comments

The build works as expected, but when compilation on save is emited following error is triggered:

screen shot 2015-12-04 at 10 48 20

tomitrescak avatar Dec 04 '15 09:12 tomitrescak

The build works as expected, but when compilation on save is emited following error is triggered:

Sorry @tomitrescak. I tried a quick test and it works fine.

asdfasdf

Can you share your tsconfig.json ... and are you using extenalTranspiler? (I'm personally not and don't even have it setup) :rose:

basarat avatar Dec 04 '15 10:12 basarat

Got it. Happens if the file is a .d.ts file ... aka doesn't have a valid js status

basarat avatar Dec 04 '15 10:12 basarat

Released: https://github.com/TypeStrong/atom-typescript/releases/tag/v7.14.0 have a nice weekend :rose:

basarat avatar Dec 04 '15 10:12 basarat

I admire your speeeeeeeeeeed :8ball: ;)

tomitrescak avatar Dec 04 '15 11:12 tomitrescak

I suspect it's possible that the failures with d.ts files might be similar to the issue I'm chasing in #755. @tomitrescak (and @basarat ) when you were experiencing (and reproducing) this bug, were you compiling into your source directory? Or targeting a build directory distinct from your source directory? #755 popped up for me when I was looking at other babel-related code, as well. I will respond to @basarat's request for followup over in that thread now.

By the way, I totally get why reverting the babel thing makes sense for now. Those of us using babel can still use that commit until it's better sorted out. I think there are a few other issues with the babel integration that might as well all get packaged up together properly, rather than trying to piecemeal them as hotfixes to the babel support.

laurelnaiad avatar Dec 05 '15 02:12 laurelnaiad

[EDIT] - Nevermind what is written below .. I had downgraded atom-typescript to previous version, therefore I had no errors. I will keep on investigating.

Hi, 7.14.1 is still failing Emit ;( Last one that works is 7.12.0 ;( I am not emiting files as per my tsconfig ... but I get the TS Emit failed message :/


  "compileOnSave": true,
  "compilerOptions": {
    "target": "es6",
    "declaration": false,
    "noImplicitAny": true,
    "removeComments": false,
    "noLib": false,
    "preserveConstEnums": true,
    "noEmitHelpers": true,
    "noEmit": true,
    "suppressImplicitAnyIndexErrors": true,
    "jsx": "preserve",
    "experimentalDecorators": true,
    "experimentalAsyncFunctions": true,
    "sourceMap": true
  },
  "awesomeTypescriptLoaderOptions": {
    "doTypeCheck": true,
    "useBabel": false,
    "emitRequireType": true,
    "forkChecker": true
  },
  "filesGlob": [
    "modules/**/*.ts",
    "modules/**/*.tsx"
  ],
  "files": [
...
  ],
  "exclude": [
    "node_modules"
  ],
  "atom": {
    "rewriteTsconfig": true
  }
}

tomitrescak avatar Dec 05 '15 15:12 tomitrescak

Hi, 7.14.1 is still failing Emit ;(

@tomitrescak I believe the stack trace would now be different. Can you share that please :rose:

basarat avatar Dec 06 '15 23:12 basarat

Bad news ;( Stacktrace is empty .. no error in console. Only the TS failed to emit error.

tomitrescak avatar Dec 10 '15 15:12 tomitrescak

ad news ;( Stacktrace is empty .. no error in console. Only the TS failed to emit error.

@tomitrescak I don't have a repro :-/ Also you seem to be the only one suffering from this at the moment. I am open to suggestions :rose:

working fine

basarat avatar Dec 11 '15 00:12 basarat

@basarat GOT IT!

The culprit is the "noEmit": true

With compilation set to some outDir no problems appear. When I turn on the noEmit rule in any of my projects I receive the TS Emit Failed.

I can reproduce this issue in ALL my projects, please test it if you have time.

tomitrescak avatar Dec 12 '15 10:12 tomitrescak

The culprit is the "noEmit": true

Wouldn't noEmit explicitly disable any emit? So we shouldn't show the message but the rest is fine? Am I mistaken? :rose:

basarat avatar Dec 13 '15 00:12 basarat

Yes, you are right. I'm not sure if on-the-fly compilation does the same as compilation on save, but the Emit Failed message should not be shown as it is a bit misleading since compilation is performed just fine.

tomitrescak avatar Dec 13 '15 10:12 tomitrescak

@tomitrescak I've created a clearer issue report : https://github.com/TypeStrong/atom-typescript/issues/780 :rose:

basarat avatar Dec 13 '15 23:12 basarat

@basarat I still get TS Emit failed when emit is set to false ;(

tomitrescak avatar Jan 11 '16 06:01 tomitrescak

@tomitrescak the issue still exits : https://github.com/TypeStrong/atom-typescript/issues/780

I have difficulty wrapping my head around why one would even need noEmit : true? Surely something must be doing the emit and that thing is effectively ignoring the noEmit option. What is that thing? :rose:

basarat avatar Jan 11 '16 23:01 basarat

My entire build process uses gulp-typescript and gulp-babel... including building the build itself -- so that no particular editor is needed, and so that we can control the streams, etc. etc. It also transpiles itself.

I always run with noEmit: true now.

(gulp-typescript happily, and correctly-for-its-use-case ignores the noEmit flag)

laurelnaiad avatar Jan 11 '16 23:01 laurelnaiad

Cool so gulp-typescript ignores noEmit (https://www.npmjs.com/package/gulp-typescript#options). If all you want is just atom to ignore emit perhaps use compileOnSave: false as a workaround till the issue is fixed :rose:

basarat avatar Jan 11 '16 23:01 basarat

Right -- difference being that the compile/buildOnSave settings prevent editor from assisting you in typechecking in-window.

I don't actually have an issue with noEmit anymore on my branch, so somewhere in there I think there's a fix (though maybe not an ideal one). I still need to deal with making that into a PR or PRs.

So, I don't need a workaround right now -- I was just chiming in with a reasoning behind wanting to run atom-typescript with noEmit turned on.

laurelnaiad avatar Jan 12 '16 00:01 laurelnaiad

@basarat I am running Webpack with ts-loader which is responsible for loading typescript and creating sourcemaps. Thereofre I do not need emission. I need compile on save to have the possibility of typechecks and more.

tomitrescak avatar Jan 12 '16 01:01 tomitrescak

I need compile on save to have the possibility of typechecks and more.

Typechecks are performed irrespective of compileOnSave (code https://github.com/TypeStrong/atom-typescript/blob/cdc8d9865a0abc8e6ca6bfb7d02e08dec675286e/lib/main/atom/onSaveHandler.ts#L31-L56). Correct me if I am wrong :rose:

basarat avatar Jan 12 '16 01:01 basarat