Error: Internal error: unknown identifier - javascript

I want to publish my angular application for production, when i run
ng build --prod --aot = false
it builds successfully, but the main.js file is large(6 MB), same with vendor.js (10 mb), which make my application so slow. So i tried running with ng build --prod, but i get this error
ERROR in : Error: Internal error: unknown identifier [{"filePath":"C:/Users/myuser/Documents/anular-app/angularpp_test/Client/myweb/node_modules/#angular/core/core.d.ts","name":"ErrorHandler","members":[]}]
this is my configuration
Angular CLI: 6.0.7
Node: 8.9.4
OS: win32 x64
Angular: 5.2.0
... animations, cdk, common, compiler, compiler-cli, core, forms
... http, language-service, material, platform-browser
... platform-browser-dynamic, router
Package Version
-----------------------------------------------------------
#angular-devkit/architect 0.6.7
#angular-devkit/build-angular 0.6.7
#angular-devkit/build-optimizer 0.6.7
#angular-devkit/core 0.3.1
#angular-devkit/schematics 0.6.7
#angular/cli 6.0.7
#angular/flex-layout 2.0.0-beta.10
#ngtools/webpack 6.0.7
#schematics/angular 0.6.7
#schematics/update 0.6.7
rxjs 5.5.2
typescript 2.4.2
webpack 4.8.3

Look in your app.modules, specifically where your provider. Must be using a
provide: [ErroHandler]
Remove this brackets.

Related

Why can't I generate an Angular component?

I started a project back in August, I was able to create components just fine. But, now when I try to generate an Angular component I receive this error
Option "entryComponent" is deprecated: Since version 9.0.0 with Ivy, entryComponents is no longer necessary.
Cannot read property 'kind' of undefined
I'm using Angular 10 and NativeScript 7
Angular CLI: 10.1.7
Node: 10.22.0
OS: darwin x64
Angular: 10.1.6
... animations, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router
Ivy Workspace: Yes
Package Version
---------------------------------------------------------
#angular-devkit/architect 0.1001.7
#angular-devkit/build-angular 0.1001.7
#angular-devkit/core 10.1.7
#angular-devkit/schematics 10.1.7
#angular/cdk 10.2.5
#angular/cli 10.1.7
#angular/material 10.2.5
#schematics/angular 10.1.7
#schematics/update 0.1001.7
rxjs 6.6.3
typescript 3.9.7

Initializing angular project fails

I am trying to set up angular project from scratch.
Below are the steps followed
Installed Node js
Installed Angular CLI using npm install -g #angular/cli#latest
Versions
Angular CLI: 9.1.4
Node: 12.16.3
OS: win32 x64
Angular:
...
Ivy Workspace:
Package Version
#angular-devkit/architect 0.901.4
#angular-devkit/core 9.1.4
#angular-devkit/schematics 9.1.4
#schematics/angular 9.1.4
#schematics/update 0.901.4
rxjs 6.5.4
Created a new app using ng new app_name
While trying to run the app through command ng serve I am getting a host of errors and app is not starting up
Have attached screen shot of the error
edit
If you use angular 9.1.6 it should be fine now
npm update #angular/cli #angular/core
original post
I had the same problem after making a fresh project using
npm install -g #angular/cli
ng new <projectname>
I believe its a bug in 9.1.5 Angular when using the 9.1.4 cli
You'll see the issue when you do
ng --version
if you get:
Angular CLI: 9.1.4
Node: 12.16.3
OS: win32 x64
Angular: 9.1.5
... animations, cli, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router
Ivy Workspace: Yes
To resolve you install 9.1.4 Angular instead by running after you've done your
ng new <projectname>
then run
npm install #angular/core#9.1.4 #angular/animations#9.1.4 #angular/common#9.1.4 #angular/forms#9.1.4 #angular/platform-browser#9.1.4 #angular/router#9.1.4 #angular/platform-browser-dynamic#9.1.4 #angular/compiler#9.1.4 #angular/compiler-cli#9.1.4 #angular/language-service#9.1.4
ng build
See my other answer for reference
ERROR in TypeError: Cannot read property 'flags' of undefined

Why is angular fire saying I'm not logged in even though firebase tools says I am?

I'm having an issue with my ng add #angular/fire command and I think this might have something to do with it. below is a screenshot of me checking my login by running firebase login, it clearly says I'm logged in. then I run a deploy to firebase command and it says "🚨 You're not logged into Firebase. Logging you in..."
Date: 2020-01-12T23:18:12.366Z - Hash: 0398eefc1b5a238b8b7e - Time: 37932ms
🚀 Your application is now available at https://devinterface-78409.firebaseapp.com/
Raphaels-MacBook-Pro:devInterface raphael_castro$ firebase login
Already logged in as raphael#rcincorporated.net
Raphaels-MacBook-Pro:devInterface raphael_castro$ ng run devInterface:deploy
🚨 You're not logged into Firebase. Logging you in...
📦 Building "devInterface"
Browserslist: caniuse-lite is outdated. Please run next command `npm update`
I've reinstalled npm, firebase, angular/fire, and angular to try and resolve this issue; no dice.
here is my angular versions:
Package Version
-----------------------------------------------------------
#angular-devkit/architect 0.803.20
#angular-devkit/build-angular 0.803.20
#angular-devkit/build-optimizer 0.803.20
#angular-devkit/build-webpack 0.803.20
#angular-devkit/core 8.3.20
#angular-devkit/schematics 8.3.20
#angular/cdk 8.2.3
#angular/cli 8.3.20
#angular/fire 5.2.3
#angular/material 8.2.3
#ngtools/webpack 8.3.20
#schematics/angular 8.3.20
#schematics/update 0.803.20
rxjs 6.4.0
typescript 3.5.3
webpack 4.39.2

module schedule/tracking does not exist in the Haste module map

React Native Environment Info:
System:
OS: macOS High Sierra 10.13.6
CPU: x64 Intel(R) Core(TM) i3-7100 CPU # 3.90GHz
Memory: 559.26 MB / 16.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 10.11.0 - /usr/local/bin/node
npm: 6.4.1 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 12.0, macOS 10.14, tvOS 12.0, watchOS 5.0
IDEs:
Xcode: 10.0/10A255 - /usr/bin/xcodebuild
npmPackages:
react: 16.0.0 => 16.0.0
react-native: ^0.57.3 => 0.57.3
npmGlobalPackages:
react-native-cli: 2.0.1
here is react-native info
similar solutions from GitHub does not work for me
The error appears due to the renaming of schedule/tracking to schedule/tracing from react#16.5.1 to react#16.5.2.
The issue is resolved by choosing the correct version of react for your react-native version:
RN <= 0.57.2 --> react <= 16.5.1
Be sure to lock your react version in this case. Your package.json should look like this: react#16.5.1. Check that there isn't any ^ before the version.
(having react#^16.5.1 in your package.json may resolve to a react version >= 16.5.1, which will NOT work)
example command: yarn add react#16.5.1
RN >= 0.57.3 --> react >= 16.6
example command: yarn add react#16.6.0
For further Information you can check the Github Issue #21150 and Github Issue #21140.
Sidenote for Expo Users:
If you are using expo, be aware that expo <= 32.0.0 uses a react-native version <= 0.57.2 and therefore will require the react version to be <= 16.5.1
If it does not work immediately
Try to reset the cache of your packager before continuing: yarn start --reset-cache
If running with your versions of npm packages:
react: 16.0.0 => 16.0.0
react-native: ^0.57.3 => 0.57.3
We'll have the same error as below:
error: bundling failed: Error: Unable to resolve module `scheduler/tracing` from
`C:\projects\rnw\node_modules\react-native\Libraries\Renderer\oss\ReactNativeRenderer-
dev.js`: Module `scheduler/tracing` does not exist in the Haste module map
Upgrade to the following versions:
"dependencies": {
"react": "16.6.3",
"react-native": "0.58.1"
},
And the error will be gone.
If there is an error related to module Schedule/tracking not found, use react-native 0.55.0 version. Above RN->0.55.0 version schedule/tracking package is renamed or moved to another module which is not found by node server.
Command: react-native init (Project Name) --version 0.55.0

Angular 5 :ERROR in No NgModule metadata found for 'AppModule'

I am trying to build my angular5 application but got the following error
on ng build.
I've tried the solution from this fix https://github.com/angular/angular-cli/issues/8798
npm cache clean --force
npm install
npm install --save-dev #angular/cli#latest
But still, I am getting the error
ERROR in No NgModule metadata found for 'AppModule'.
Versions
Angular CLI: 6.2.3
Node: 9.9.0
OS: linux x64
Angular: 5.2.9
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router
Package Version
---------------------------------------------------------
#angular-devkit/architect 0.7.5
#angular-devkit/build-angular 0.7.5
#angular-devkit/build-webpack 0.7.5
#angular-devkit/core 0.8.3
#angular-devkit/schematics 0.8.3
#angular/cli 6.2.3
#schematics/angular 0.8.3
#schematics/update 0.8.3
rxjs 5.5.7
typescript 2.5.3
webpack 4.19.1
UPDATE
main.ts
import { enableProdMode } from '#angular/core';
import { platformBrowserDynamic } from '#angular/platform-browser-dynamic';
import { AppModule } from './app/app.module';
import { environment } from './environments/environment';
if (environment.production) {
enableProdMode();
}
platformBrowserDynamic().bootstrapModule(AppModule)
.catch(err => console.log(err));

Categories