One of the modules ionic declaration consists of

Upon executing the

ionic cordova build android --release --prod
command, an error message is displayed in the console. Can anyone provide guidance on how to proceed? I am eagerly awaiting this to publish my app.

 `Type LoginPage in c:/Users/Mike/Desktop/GuiaCorretor/src/pages/login/login.ts is part of
  the declarations of 2 modules: AppModule in c:/Users/Mike/Desktop/GuiaCorretor/src/app/app.module.ts and LoginPageModule`

Below is my app.module.ts:

import { LoginPage } from './../pages/login/login';
import { SobrePage } from '../pages/sobre/sobre';
import { PrediosPage } from "../pages/predios/predios";
import { NovidadesPage } from '../pages/novidades/novidades';
import { SocialPage } from '../pages/social/social';

@NgModule({
  declarations: [
    MyApp,
    LoginPage,
    SobrePage,
    PrediosPage,
    NovidadesPage,
    SocialPage,

  ],
  imports: [
    BrowserModule,
    IonicModule.forRoot(MyApp),
    AngularFireModule.initializeApp(FIREBASE_CONFIG),
    AngularFireAuthModule,
    IonicStorageModule.forRoot()

  ],
  bootstrap: [IonicApp],
  entryComponents: [
    MyApp,
    LoginPage,
    SobrePage,
    PrediosPage,
    NovidadesPage,
    SocialPage,

  ],
  providers: [
    StatusBar,
    SplashScreen,
    {provide: ErrorHandler, useClass: IonicErrorHandler}
  ]
})
export class AppModule {}

The following snippet shows my login.module.ts, including the import:

`import { NgModule } from '@angular/core';
import { IonicPageModule } from 'ionic-angular';
import { LoginPage } from './login';

@NgModule({
  declarations: [
    LoginPage,
  ],
  imports: [
    IonicPageModule.forChild(LoginPage),
  ],
})
export class LoginPageModule {}
`

![To complement, here's a snapshot displaying the error appearing in my terminal ]1

Answer №1

To achieve your goal, you should exclude the LoginPage declaration from your AppModule and incorporate LoginModule into your AppModule. Remember, a component like LoginPage can only be declared in one module.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Class property in Typescript is initialized in the constructor, but is undefined in a member function

I'm encountering a recurring problem while developing an Electron application using Typescript. The backend has a set of controllers, with the AppController managing file system interactions and WindowController handling basic window functions. Here&a ...

Error: The variable _ is undefined when trying to use the .map() function on an array

While working on my project, I encountered a "ReferenceError: _ is not defined" when using the .map function in this code snippet: arr.map(async (elem) => { ... }); I couldn't find any explicit mention of "_" in my code. The error trace pointed me ...

Angular 2 : Encountering an issue when statically resolving symbol values - Is there a way to convert this into a factory method?

Upon installing Angular-cli, an error has surfaced: A problem arose while resolving symbol values statically. Function calls are not supported. To resolve this, consider replacing the function or lambda with a reference to an exported function (position 5 ...

The model does not align with the body request, yet it is somehow still operational

My programming concept: class User { username: string; password: string; } Implementation of my function: const userList = []; function addUser(newUser: User) { userList.push(newUser); } Integration with Express router: router.post('/user ...

Changing the name of a tab within a p-tabview

Setting up a p-tabview with tabs containing specific content involves the following code: <p-tabView class="tabmain" > <ng-container *ngFor="let tab of tabs"> <p-tabPanel [header]="tab.header" > ...

Angular issue: "Unable to bind to 'ngModel' as it is not recognized as a property of 'input'"

While working with Angular 4, an error message appears in the console: The 'ngModel' property cannot be bound since it is not recognized as a valid property of the 'input' element Is there a solution to fix this issue? ...

Struggling to import a React component for sharing purposes

I've developed a React component that I want to share through a locally hosted npm repository. To achieve this, I created the React component using typescript, transpiled it to JavaScript, and then published the resulting code to the repository. Howe ...

The color scheme detection feature for matching media is malfunctioning on Safari

As I strive to incorporate a Dark Mode feature based on the user's system preferences, I utilize the @media query prefers-color-scheme: dark. While this approach is effective, I also find it necessary to conduct additional checks using JavaScript. de ...

Using Typescript with Angular 2 to Implement Google Sign-In on Websites

Currently, I am in the process of creating a website that utilizes a typical RESTful web service to manage persistence and intricate business logic. To consume this service, I am using Angular 2 with components coded in TypeScript. Instead of developing m ...

Restrict toggling of MatExpansionPanel in Angular Material to only be triggered by clicking on the arrow icon

Utilizing Angular Material for my expanding panels, I am facing an issue with the toggling functionality. I would like the panel to expand and contract only when clicking on the arrow, not anywhere in the header area where I plan to place a checkbox. Curre ...

Error encountered when attempting to retrieve token from firebase for messaging

I am currently working on implementing web push notifications using Firebase. Unfortunately, when attempting to access messaging.getToken(), I encounter an error stating "messaging is undefined." Below is the code snippet I am utilizing: private messaging ...

Injecting a useFactory provider in Angular is a common practice

I manage a factory provider service that selects a service based on a flag. Everything works fine when I need a debug students service, but when I set the flag to false, the application throws an ERROR TypeError: serverService.fetchData is not a function. ...

Transpilation appears to dissect a function

I've encountered a strange issue where the transpiler is splitting a single method into two parts: Before transpiling: MemberSchema.methods.addAccount = (account: IAccount): void => { this.account = new Account({ ...account, i ...

Utilizing object as props in ReactJS with TypeScript

I'm new to working with ReactJS, and I made the decision to use typescript for my current project. The project is an application that fetches movies from an API and displays them. Take a look at the app: import React from 'react'; import &a ...

Issues with managing stages in Typescript using Quasar and Vue are obstructing progress

I'm completely new to working with vuex and I'm facing some challenges in getting it set up properly. Here is the current structure of my store folder: store module-example index.ts mutations.ts getters.ts state.ts index.ts store-flag.d.ts T ...

NG0900: Issue encountered while attempting to compare '[object Object]'. Please note that only arrays and iterable objects are permitted for comparison

Experimenting with an Angular project where I am retrieving data from a Minecraft API and displaying it on my website. This is my first time working with Angular's HTTP requests. Encountered the following error code; NG0900: Error trying to diff &apo ...

Issue with integrating jQuery in an Angular 2 Typescript environment

Hi, I am utilizing jQuery within an Angular 4 TypeScript project. I have attempted to use the following two events to fix the table header, but unfortunately, it is not working as expected. ngOnInit(): void { $(document).ready(function() { $( ...

Maintaining the ngFor value when clicked and passing it to another component

Currently tackling an angular project and seeking assistance with a particular issue... I have successfully displayed data from an array, but now I am looking to store the value of the element I click on so that I can utilize it in another component along ...

Need for utilizing a decorator when implementing an interface

I am interested in implementing a rule that mandates certain members of a typescript interface to have decorators in their implementation. Below is an example of the interface I have: export interface InjectComponentDef<TComponent> { // TODO: How ...

Error message: The variable referenced in the subscription is not recognized outside the scope in Angular 2 when

When working with my Angular2 component, I encountered a situation where I needed to store a value from Firebase into a variable inside the constructor. Like so: this.dbAction.getDB().take(1).subscribe(data => { this.userVisitOrder = data[0][this.cur ...