bonjurmrfirst / ng4-files

20 stars 15 forks source link

ERROR in ./node_modules/angular4-files-upload/index.ts in the angular: 5.0.1 #13

Open vedantkarande93 opened 6 years ago

vedantkarande93 commented 6 years ago

It is working in the angular version 4.4.4 but while updating angular version to 5, it is showing

ERROR in ./node_modules/angular4-files-upload/index.ts this error.

How to solve this issue?

mjurczyk commented 6 years ago

Due to angular-cli issues, you must add the module manually to your tsconfig.json:

{
   /* ... config ... */
  "include": [
    /* ... project files paths ... */,
    "node_modules/angular4-files-upload/index.ts"
  ]
}
vedantkarande93 commented 6 years ago

This above Lines are giving me an error and I have added these link in the tsconfig.json file like below;

{ "compilerOptions": { "baseUrl": "", "declaration": false, "emitDecoratorMetadata": true, "experimentalDecorators": true, "lib": [ "es2016", "dom" ], "mapRoot": "./", "module": "es2015", "moduleResolution": "node", "outDir": "../dist/out-tsc", "sourceMap": true, "target": "es5", "typeRoots": [ "../node_modules/@types" ], "include": [ / ... project files paths ... / "node_modules/angular4-files-upload/index.ts" ] } }

Throwing an error of

error TS5023: Unknown compiler option 'include'

mjurczyk commented 6 years ago

@vedantkarande93 include is not a part of compilerOptions, you should define it outside. Please see https://www.typescriptlang.org/docs/handbook/tsconfig-json.html for examples.

jlobaton commented 6 years ago

How to solve this issue?

johnjkjung commented 6 years ago

@jlobaton With angular5, I met 'ERROR in Error: Error encountered resolving symbol values statically'.

  1. In the end, I just decided to copy the whole module folder of '/ng4-files' into mine.
  2. And change the source name from 'angular4-files-upload' to './ng4-files' on my app.module declaration. And all problems solved!

This app is actually wrapping 'ng4-files' module inside. So, this way seems safer.

Jeff-Li-Realster commented 6 years ago

@mjurczyk I did add 'angular4-files-upload/index.ts' into tsconfig file, then I got this error: 'angular4-files-upload/src/index.ts' is not part of the compilation output. After also adding this one, then I got a new error: 'angular4-files-upload/src/app/index.ts' is not part of ....... It just kept looking for another index file inside. SO Strange

andre-huehn commented 6 years ago

If you specifically add an include statement, you also need to add your other source files, so that angular cli can find everything. (also double check the path to the angular 4 files upload component) e.g.: "include": [ "node_modules/angular4-files-upload/index.ts", "src/*/.ts ]

djErock commented 6 years ago

Added it to tsconfig.app.json instead of tsconfig.json ...

{ "compileOnSave": false, "compilerOptions": { "outDir": "./dist/out-tsc", "sourceMap": true, "declaration": false, "moduleResolution": "node", "emitDecoratorMetadata": true, "experimentalDecorators": true, "target": "es5", "typeRoots": [ "node_modules/@types" ], "lib": [ "es2017", "dom" ] }, "include": [ "node_modules/angular4-files-upload/index.ts" ] }

djErock commented 6 years ago

Do I have to manually upload the ng4-files folder into the project? I cannot get the desired output. Just keep getting: ERROR in Error: No NgModule metadata found for 'AppModule'.

djErock commented 6 years ago

I downloaded your project, copy/pasted the ng4-files into my components folder and the errors went away. Referencing the node modules folder was not working in my Angular CLI (5.0.3) project. This is not good for maintenance purposes but I wasn't looking to re-create the wheel anyways so Thank you.