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

index.ts is not part of the compilation output. #24

Closed
Pikachews opened this issue Nov 5, 2017 · 9 comments
Closed

index.ts is not part of the compilation output. #24

Pikachews opened this issue Nov 5, 2017 · 9 comments

Comments

@Pikachews
Copy link

Pikachews commented Nov 5, 2017

This issue seems to come up when using Angular v5.0.0.
It's being discussed here: angular/angular-cli#8263
A workaround to this issue can be found here: angular/angular-cli#8284 (comment)
But is it possible to get it fixed in the package itself?

Long story short: TS source files shouldn't be included in the package.
A simple, temporary fix for users of this package is to simply rename index.ts to index.js.

@flaska
Copy link

flaska commented Nov 7, 2017

+1 Same for me after upgrading to sweet A5.

Thanks for the links.

@moose4lord
Copy link

I fell victim to this issue too. The suggestion to rename index.ts to index,js worked for me. Thanks for the tip. Be nice to get the package fixed. I know I'm going to delete my node_module directory someday and do a "npm install" and be right back here. :)

@dae721
Copy link

dae721 commented Dec 13, 2017

Here's an alternative workaround that worked for me. Instead of renaming index.ts, I added the following to tsconfig.json:

  "include": [
    "node_modules/ng-diff-match-patch/index.ts",
    "src/**/*"
  ]

@fakkeldij
Copy link

Same issue here, dae721 comment works for me, so added it to the tsconfig.json file.

ERROR in ./node_modules/ngx-markdown-editor/index.ts
Module build failed: Error: D:\chat\mean-chat\node_modules\ngx-markdown-editor\index.ts is not part of the compilation output. Please check the other error messages for details.
at AngularCompilerPlugin.getCompiledFile (D:\chat\mean-chat\node_modules@ngtools\webpack\src\angular_compiler_plugin.js:648:23)
at plugin.done.then (D:\chat\mean-chat\node_modules@ngtools\webpack\src\loader.js:467:39)
at
at process._tickCallback (internal/process/next_tick.js:188:7)
@ ./src/app/app.module.ts 54:0-60
@ ./src/main.ts
@ multi webpack-dev-server/client?http://0.0.0.0:0 ./src/main.ts

@randyaa
Copy link

randyaa commented Jan 2, 2018

I added the following as a node script that now runs before any of my builds:

var fs = require('fs');
(function() {
    fs.exists( './node_modules/ng-diff-match-patch/index.ts', (exists) => {
        if (exists) {
            fs.renameSync('./node_modules/ng-diff-match-patch/index.ts', './node_modules/ng-diff-match-patch/index.js');
            console.log('Renamed ng-diff-match-patch/index.ts to .js');
        } else {
            //TODO this script is only needed until there's a resolution to https://github.com/elliotforbes/ng-diff-match-patch/issues/24
            console.log('No ng-diff-match-patch/index.ts to rename! CAN THE SCRIPT BE REMOVED NOW?')
        }
    });
})();

not the best solution but it takes care of it for now. I'm not sure why @dae721 's solution didn't work for me but i didn't spend time investigating why.

elliotforbes pushed a commit that referenced this issue Jul 3, 2018
Restructure as Angular library to solve #24 and support Angular 5+
@bjarecki
Copy link

bjarecki commented Jul 7, 2018

I see a merge a few days ago, I still get this error in Angular 5+ as of a few minutes ago,

@elliotforbes
Copy link
Owner

Hi @bjarecki,
can you try again with the 3.0.1 version now published on NPM?
Kind Regards,
Elliot

@moose4lord
Copy link

I tried v3.0.1 in my Angular 5 dev env and this issue seems to be fixed now. No more "index.ts is missing from the TypeScript compilation" error. It also works with Angular 6. Nice job, Elliot. Thanks.

@elliotforbes
Copy link
Owner

@AndersTornkvist thank you very much for providing the fix for this issue! You are an absolute legend.

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

No branches or pull requests

8 participants