Please add a #Pipe/#Directive/#Component annotation in Angular 6 - node.js

In Angular6, I have an error Please add a #Pipe/#Directive/#Component annotation
I used angular CLI version: 6.1.4
angular version:6.1.3
Node:10.9.0
NPM: 6.2.0
When I run ng serve in Terminal its compiled but in browser localhost:4200 try its shown error.
error display in Below error.
Output
enter image description here

in my case I had a custom module being Declared in the AppModule. This was unnecessary as the app-routing was handling the custom modules. Just remove the declaration and it worked. hope this helps someone

Related

This version of CLI is only compatible with Angular versions ^15.0.0, but Angular version 14.2.12 was found instead

I am upgrading my application from angular 13 to 14.
For angular 13 everything was working fine but after doing the angular 14 updates I am facing this error and am unable to understand where I am making the mistake.
Node: 14.21.1
enter image description here
I tried to changing "#angular-devkit/build-angular": "^13.3.10" but no luck
Please refer to:
https://github.com/manfredsteyer/ngx-build-plus/issues/361
Your issue seems similar to this one and the resolution would be the same mostly but in case you want to get it fixed by the TPL author
You will have to figure out which TPL is causing the issue run
yarn list #angular-devkit/build-angular
This would tell you which TPL requires the 15 version of angular in your project.
Hope this helps :)

pg-promise in Angular app gives many 'Module not found' errors

I am including pg-promise in my Angular app to make some queries.
My app is targeting browsers and I am willing to deploying it via ng build --prod.
However, when I launch the development server with Angular CLI using ng serve I get lots of errors and my app does not work since I imported pg-promise with:
import * as pgPromise from 'pg-promise';
Errors are like Module not found: Error: Can't resolve 'XXX' in 'path.
I tried to solve with the solutions provided in this answer:
Open src/tsconfig.app.json*.
Add "node" to the "types" array.
, and installing node types via npm i #types/node, but nevertheless I am still hitting the same errors.
Finally, lookig at the types declared in the pg-promise.d.ts file, I can clearly see there's an error which makes me think is the cause of the problems I am having. VScode is telling me that it Cannot find namespace 'NodeJS'.ts(2503).
Any suggestion on how I should include pg-promise in my app without all these errors?

JHipster - prod build is not working correctly

I worked a lot on my JHipster project. After 3 weeks I packaged the project again and tried to run the war.
The war is running but the problem is that there is a problem with the frontend. It shows the Hipster error "An error has occured :-(...".
The console logs:
Uncaught TypeError: Cannot read property 'concat' of undefined
at Module.503
I'm just confused because when I run npm start, everything works. I didn't change the webpack or package.json. I'm using the newest JH version.
I solved my issue. We are using index files in Angular. The order of the exports was not correct. We exported the module first and the module tried to access data from the index which was not exported at this time.
Hope I could help you.

Unable to find src/main/webapp/app/blocks/config/http.config.js or missing required jhipster-needle. Interceptor not added to JHipster app

I just generated a project with jhipster normally. I am now trying to use the Bootswatch theme by typing the command npm install -g generator-jhipster-bootswatch and yo jhipster-bootswatch as shown on their website and I have this error:
Unable to find src/main/webapp/app/blocks/config/http.config.js or missing required jhipster-needle. Interceptor not added to JHipster app.
version :
jhipster 4.13.3
Can someone help me solve this problem?
generator-jhipster-bootswatch is 2 years old , its not compatible with Angular 5 in JHipster 4 (see issue)

react-native attempting to resolve built-in fetch function

I'm attempting to use the fetch function in react-native to grab a piece of data from the web. from what I understand reading the docs, the fetch function is built in to react-native.
when doing so, I get the module resolution error in the attached screenshot, where for whatever reason the react-native bundler is attempting to use the fetch provided by typescript from my ~/.cache directory.
I've previously had typescript 2.6 installed globally via npm, I uninstalled it to see if that might fix things, but the error persists.
I should note that the only things I've done for this project are to create it with create-react-native-app, add a little snippet to the App.js component stolen from the react docs to fetch some JSON, and yarn run eject the project (this error persisted before and after the ejection)
well in my turkey-induced frenzy, it appears I hadn't properly uninstalled the global typescript install on my computer.
having done so properly, the issue is resolved;
however the issue of react-native's module resolution strategy being incompatible with a global typescript installation persists.

Resources