Unable to use instamancer in Angular CLI project
See original GitHub issueI am trying to use instamancer as part of an Angular project. When I try to compile angular and run the website with the instamancer node module, it gives me the below error:
ERROR in ./node_modules/instamancer/src/api/api.ts Module build failed (from ./node_modules/@ngtools/webpack/src/index.js): Error: /Volumes/SD_CACHE/PHPStorm/dmsolutions-angular/node_modules/instamancer/src/api/api.ts is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property. The missing file seems to be part of a third party library. TS files in published libraries are often a sign of a badly packaged library. Please open an issue in the library repository to alert its author and ask them to package the library using the Angular Package Format (https://goo.gl/jB3GVv). at AngularCompilerPlugin.getCompiledFile (/Volumes/SD_CACHE/PHPStorm/dmsolutions-angular/node_modules/@ngtools/webpack/src/angular_compiler_plugin.js:912:23) at plugin.done.then (/Volumes/SD_CACHE/PHPStorm/dmsolutions-angular/node_modules/@ngtools/webpack/src/loader.js:41:31) at process._tickCallback (internal/process/next_tick.js:68:7)
I tried editing my tsconfig.json like the error recommended, but it remains unresolved as it asks me to include more and more files from Instamancer, which results in more errors reported.
My machine information:
- OS: MacOS 10.11 El Capitan
- Instamancer version 1.4.2
- Node version 10.16.2
- NPM version 6.10.3
- Angular CLI: 8.2.2
- Angular: 8.2.2
To reproduce this error, I tried replicating the ES2018 Typescript example in an angular service, but it is unable to compile with “ng build”.
Is Instamancer incompatible with Angular?
Issue Analytics
- State:
- Created 4 years ago
- Comments:9 (4 by maintainers)
Top GitHub Comments
Ok Sir. Thank you. I will try it.
Here’s a quick example:
Visiting
localhost:3000/cached
will return a list of posts that’s updated once every 5 minutes, and visitinglocalhost:3000/live?tag=your_tag_here
will fetch them on-demand.You have to wait 30-seconds to a minute for the cached posts to appear, and you’ll have to wait about as long for something to be returned on the live endpoint. That should get you started.