When constructing an Ionic 4 project, encountering an error due to the declaration of "name" in the "path" being linked to 2 modules

I attempted to compile my Ionic app using the following commands:

ionic cordova platform add browser

and then

ionic cordova build browser --prod --release

However, I encountered an unusual error:

You can find my project on GitHub here: https://github.com/TenPetr/to_do_list

Angular version being used: 8.1.2

Current Ionic version: 4.7.1

Thank you in advance for any guidance or advice provided.

Answer №1

It seems that there is an error in your code where you have declared AddNewLabelsPage in both AppModule and AddNewLabelsPageModule.

To fix this issue, remove the declaration from AppModule and make sure to update the AppModule configuration to import your AddNewLabelsPageModule.

Your app.module should be modified as shown below:

@NgModule({
  declarations: [
    AppComponent,
    DoneAllPage,
    SettingsPage
  ],
  entryComponents: [AddNewTaskPage, DoneAllPage, SettingsPage],
  imports: [
    BrowserModule,
    FormsModule,
    IonicModule.forRoot(),
    AppRoutingModule,
    AddNewTaskPageModule
  ],
  providers: [
    StatusBar,
    SplashScreen,
    TimeDateService,
    TasksService,
    LabelsService,
    SettingsService,
    { provide: RouteReuseStrategy, useClass: IonicRouteStrategy }
  ],
  bootstrap: [AppComponent]
})
export class AppModule {}

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

Generate types based on properties of a nested interface dynamically

Consider the setup provided: enum FormGroups { customer = 'customer', address = 'address', } interface Customer { 'firstName': string; } interface Address { 'street': string; } interface SomeFormEvent { ...

Issue with NGXS Selector Observable not reflecting updated state

My issue is that when I update the state, my selector does not pull the new values. I have defined the selector in my state and I can see the state values getting updated. However, the selector in my component is not fetching the latest values. Even though ...

Argument typed with rest properties in Typescript objects

I'm relatively new to Typescript and have managed to add typings to about 90% of my codebase. However, I'm struggling with rest/spread operators. While going through our code today (which I didn't write), I came across this snippet that does ...

Leveraging the ng-template in a broader context

I need to create a recursive menu from JSON data with a specific structure. The JSON looks like this: this.menus = [{ "id": 1, "title": "Azure", "class": "fa-cloud", "url": "#", "menu": [{ "id": 121, ...

Exploring the synergy between radio buttons and the Next JS framework

To highlight an issue I encountered in a Next JS app, I decided to create a test app named radio-flash-test. Here are the commands I used to create the app: % npx create-next-app@latest ..... % cd radio-flash-test % heroku create radio-flash-test The ...

assign data points to Chart.js

I have written a piece of code that counts the occurrences of each date in an array: let month = []; let current; let count = 0; chartDates = chartDates.sort() for (var i = 0; i < chartDates.length; i++) { month.push(chartDates[i].split('-&ap ...

Providing a conditional getServerSideProps function

Is there a way to dynamically activate or deactivate the getServerSideProps function using an environment variable? I attempted the following approach: if (process.env.NEXT_PUBLIC_ONOFF === 'true') { export const getServerSideProps: Get ...

Creating ngModel dynamically with *ngFor in Angular 2: A guide

I've been struggling with this for the past couple of days - how can I have a new ngModel for each iteration within an *ngFor loop? The idea is that I load a list of questions, and within each question there are 2 propositions. Here's the HTML: & ...

Converting data received from the server into a typescript type within an Angular Service

Received an array of Event type from the server. public int Id { get; set; } public string Name { get; set; } public DateTime Start { get; set; } public DateTime End { get; set; } For Angular and TypeScript, I need to transform it into the following clas ...

Angular FlexLayout MediaObserver: How to determine the active width using a specific div?

I am currently working on customizing the behavior of fxFlex. The web application I am working on has the capability to function as a standalone version, occupying the full screen of a web browser, as well as being embedded as a web component. It is design ...

What is the proper way to address the error message regarding requestAnimationFrame exceeding the permitted time limit?

My Angular application is quite complex and relies heavily on pure cesium. Upon startup, I am encountering numerous warnings such as: Violation ‘requestAnimationFrame’ handler took 742ms. Violation ‘load’ handler took 80ms. I attempted to resolve ...

Competing in a fast-paced race with JavaScript promises to guarantee the completion of all

How can I retrieve the result of a Javascript Promise that resolves the fastest, while still allowing the other promises to continue running even after one has been resolved? See example below. // The 3 promises in question const fetchFromGoogle: Promise&l ...

How can I shift the button's location within a pop-up in Ionic 1?

enter image description here I am struggling to make the button green underneath the three other buttons. Can someone please assist me with this? Here is my code: $scope.showIntroductionPage = function(childs){ if(childs == 0){ var myPopup = $io ...

Unable to define the type for the style root in Typescript

I am encountering an error that is asking me to code the following types in the root tag: No overload matches this call. Overload 1 of 2, '(style: Styles<Theme, {}, "root">, options?: Pick<WithStylesOptions<Theme>, "fli ...

Dealing with typescript error due to snakecase attributes being sent from the database while the frontend only accepts pascalcase attributes

I am facing a challenge regarding converting snake case values from my api to pascal case attributes in the front end. Here is the scenario: Frontend Request Axios request fetching multiple user data, for example: axios.get('/users') API Resp ...

Tips on how to dynamically uncheck and check the Nebular checkbox post-rendering

I incorporated a nebular theme checkbox into my Angular 8 App. <nb-checkbox [checked]="enable_checked" (checkedChange)="enable($event)">Enable</nb-checkbox> I am able to update the checkbox using the Boolean variable "enable_checked". Initia ...

The value of 'This' is not defined within the subscribe function

Need help debugging a subscribe statement where 'this' is always undefined inside it. Specifically, 'this.dataLoaded' is coming up as undefined. How can I ensure that it is defined during debugging? this.router.events .filt ...

The Angular test spy is failing to be invoked

Having trouble setting up my Angular test correctly. The issue seems to be with my spy not functioning as expected. I'm new to Angular and still learning how to write tests. This is for my first Angular app using the latest version of CLI 7.x, which i ...

Utilizing Electron: Integrating Native Binary Dependencies Through Webpack

I am exploring the use of Webpack in my electron project to bundle the Typescript code in the main process (the renderer is managed as an Angular project with the CLI). However, in my main process, I rely on registry-js: import { enumerateValues, HKEY } ...

Ensuring Proper Typing for Conditional Arrays in Typescript: A Guide

I struggled to find a satisfactory way to define arrays with conditional elements, despite the various methods discussed here. As a result, I decided to simplify the declaration process by creating a helper function. While the helper function itself is str ...