Skip to content
This repository has been archived by the owner on Oct 5, 2019. It is now read-only.

Error on ng serve with angular-cli 1.5.0 and angular version 5.0.1. ng2-datetime.ts is not part of the compilation output #207

Open
tauqeer81 opened this issue Nov 10, 2017 · 9 comments
Labels

Comments

@tauqeer81
Copy link

I'm getting this error after upgrading my app to angular version 5.0.1 and angular-cli to 1.5.0

ERROR in ./node_modules/ng2-datetime/ng2-datetime.ts Module build failed: Error: /node_modules/ng2-datetime/ng2-datetime.ts is not part of the compilation output. Please check the other error messages for details. at AngularCompilerPlugin.getCompiledFile (/node_modules/@ngtools/webpack/src/angular_compiler_plugin.js:629:23) at plugin.done.then (/home/tauqeer/www/itsrelevant/ir_angular/node_modules/@ngtools/webpack/src/loader.js:467:39) at <anonymous> at process._tickCallback (internal/process/next_tick.js:188:7) @ ./src/app/routes/routes.module.ts 29:0-61 @ ./src/app/app.module.ts @ ./src/main.ts @ multi webpack-dev-server/client?http://0.0.0.0:0 ./src/main.ts

any help?

@tauqeer81 tauqeer81 changed the title Error on ng serve with angular-cli 1.5.0 and angular version 5.0.1 Error on ng serve with angular-cli 1.5.0 and angular version 5.0.1. ng2-datetime.ts is not part of the compilation output Nov 10, 2017
@tobiashoeft
Copy link

Same problem here

@vikasverma93
Copy link

Hi, after some research I got my project working.
Please note that my project was generated using angular-cli version 1.5.0
So, basically with angular 5, they have changed which TS files would be compiled.

One of these solutions might work for you

  1. tried to include ./node_modules/ng2-datetime/ng2-datetime.ts in my tsconfig.app.json, so that it is available during the compilation process
  2. Instead of compiling ng2-datetime.ts in your project with current version of [email protected]; you should import from the compiled module, like this import {NKDatetimeModule} from 'ng2-datetime/ng2-datetime.js';

Additionally you might get addition error like jQuery is not defined, which can be fixed by including jquery type in compiledOptions of you tsconfig.app.json

So, your tsconfig.app.json would look like this


{
  "extends": "../tsconfig.json",
  "compilerOptions": {
    "outDir": "../out-tsc/app",
    "module": "es2015",
    "baseUrl": "./",
    "types": [
      "jquery"
    ],
    "allowSyntheticDefaultImports": true
  },
  "include": [
    "**/*.ts",
    "../node_modules/ng2-datetime/ng2-datetime.ts"
  ],
  "exclude": [
    "test.ts",
    "**/*.spec.ts"
  ]
}

Let me know if you still face any issues. Thanks.

@Darth-Vader-2020
Copy link

Thank you vikasverma92. With your help, I was able to get this to work.

@nkalinov
Copy link
Owner

nkalinov commented Jan 2, 2018

@tauqeer81 Were you able to make it work?
I will try to setup the demo project with angular cli for the next version

@enigmatik
Copy link

don't work

@bculley
Copy link

bculley commented Feb 7, 2018

None of these options, nor anything else I've tried as made this ng5 compatible for me during karma tests

@OskarKlintrot
Copy link

This issue occurs for me when using TS v2.6.x but not with TS v2.5.x.

@OskarKlintrot
Copy link

I needed to add the last two files below to tsconfig:

{
  "include": [
    "**/*.ts",
    "../../node_modules/ng2-datetime/ng2-datetime.ts",
    "../../node_modules/ng2-datetime/src/ng2-datetime/ng2-datetime.ts",
    "../../node_modules/ng2-datetime/src/ng2-datetime/ng2-datetime.module.ts"
  ]
}

@simg
Copy link

simg commented Mar 13, 2018

None of the above solutions worked for me. What did work was switching to this fork of ng2-datetime.

https://www.npmjs.com/package/ngx-datetime (sorry nkalinov)

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

No branches or pull requests

9 participants