Encountered an unresolved module error in Angular 7 when trying to find the module relative to a specific path

I recently started working with Angular 7 and wanted to implement lazy loading. However, after following all the necessary steps, I encountered the following issue.

Error :

Could not resolve module ./Modules/itemmaster/itemmaster.module relative to app\Modules\initialRouting.ts

Folder Structure : https://i.sstatic.net/BWjcg.png

And :

  {path:'Item Master',  loadChildren:'./Modules/itemmaster/itemmaster.module#ItemMaster'}

Would appreciate any help in resolving this issue.

Location Of InitialRouting.ts

https://i.sstatic.net/mKY6t.png

Answer №1

Give this a shot (eliminate the /Modules path):

{path:'ItemMaster',  loadChildren:'./itemmaster/itemmaster.module#ItemMasterModule'}

Answer №2

This is the correct format

{path:'ItemMaster', loadChildren:'../Modules/itemmaster/itemmaster.module#ItemMaster'}

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

Encountering difficulties in establishing connection between Angular project and .Net API

I have been working on creating a login page using .Net Core Web API and Angular. However, I am encountering an error when trying to call the login method and make the API call upon button click. Below is the code snippet for the API: [HttpGet] [Route(&qu ...

What's causing the immediate exit when a new Promise is created?

In my case, I am encountering simple scenarios where I need to pause for a few seconds before proceeding with the execution. I attempted to create a separate timeout function by exporting the module or function individually, but nothing seems to be effect ...

Having difficulties viewing the sidemenu icon on Ionic 3, despite enabling the menu through MenuController

I am trying to show the sidemenu icon on my Home page, which users can access from the Add-Contract page. Even though I have enabled the sidemenu in home.ts using this.menu.enable(true);, the icon is not visible. However, I can still swipe and access the ...

Problem: Unable to open Angular href links on IOS devices

I am experiencing an issue with a shared-code application in Android and IOS. The link successfully opens on an Android device but fails to open on an IOS device. Are there any differences between the two platforms that could be causing this discrepancy? ...

Using Promise.all for multiple function calls

I have several functions set up like this: private async p1(): Promise<Result> { let p1; // Do some operations. return p1; } private async p5(): Promise<void> { // Make a call to an external API. } Some of these functions c ...

What is the procedure for extracting specific elements from a JSON response and transforming them into an array that adheres to a defined

In order to retrieve the JSON response of a GET request made by a service within my app to our backend, extract specific parts from it, and store them in an Array based on an Interface I have created for future use. Here is a sample of the JSON data: [{ ...

Node module for Nativescript angular project that enables multi select dropdown or picker functionality

Does anyone know of a Node NPM module for creating a multi-select dropdown in NativeScript Angular? I've searched through many plugins in the NativeScript marketplace, but haven't been able to find one that fits my needs. I need the plugin to wo ...

Utilizing various filters and sorting options on API response within Angular 8

Upon receiving the following API response: [ { "imgPaths":[ "gallery/products/55ccb60cddb4d9bded02accb26827ce4" ], "_id":"5f3e961d65c6d591ba04f3d3", "productName":" ...

Receive a 500 error when trying to express post without using a router or subs

Here is the setup I am working with: When a user posts to /register, the server will use Passport and Mongoose to register the user. If there is a UserExistsError, the server sends this information to the client through HTTP error handling. However, the ...

Experiencing a type error within Redux in a React Native project utilizing TypeScript

I am currently working on implementing a feature to store the boolean value of whether a phone number is verified or not. Within my login component: await dispatch(setOTPVerified(data.is_phone_verified)); Action.tsx: export const OTP_VERIFIED = 'OTP ...

Dynamically load components within a modal window

I am looking for a way to dynamically load a custom component inside a modal while keeping it as flexible as possible. Here is an example : -HTML CODE- <button id="floating_button" class="floating_button animation_floating_in" (click)="loadCustomComp ...

Is it accurate to say that an Angular 6 build using the --prod flag results in a /dist folder that is 7 times larger

After completing my first production build, I noticed that it is 777kb in size. My /src file itself is 117kb. While I understand that the build size may increase due to dependencies, I have struggled to find reliable information online to determine if my b ...

What could be the reason for operators like tap and map not being invoked on the inner observable when combineLatest is used?

Can you clarify why the operators tap and map of inner observable are not being called? Shouldn't combineLatest subscribe to the observables it receives in obsArr? Why are these operators not triggered by this subscription? const obsArr = []; [[1, 2 ...

Scroll horizontally in Ionic 3 without displaying the scrollbar by implementing a button

Is there a way to implement ion scroll in such a manner that upon clicking the right arrow button, it smoothly transitions to the next element within the div section of ion content in Ionic 3 without displaying any scrollbar? I want the scrollbar to remain ...

The element within the iterator is lacking a "key" prop, as indicated by the linter error message in a React component

Encountering an error stating Missing "key" prop for element in iteratoreslintreact/jsx-key {[...Array(10)].map((_) => ( <Skeleton variant="rectangular" sx={{ my: 4, mx: 1 }} /> ))} An attempt to resolve this issue was made ...

Typescript with Angular: Despite having 7 values in the map, Map.get is returning undefined

Why does Map.get always return undefined when using a number from a form element (extra1) in this code snippet? extraById = new Map<number,Extra>(); @Input() extra1: number = -1; formChanged(carConfigurationFormChanged : any) { const index ...

Angular CLI - managing separate development and production assets

Is there a way to switch to a different set of assets when using the --prod flag with ng build? In my scenario, I have multiple projects that share a common set of assets in a designated folder. Each project's configuration in angular.json looks simi ...

Error message: The rootLocator function in NativeScript RadListView is not able to be

I encountered a strange error when using RadListView in the following code: <RadListView [items]="dataItems"> <ng-template tkListItemTemplate let-item="item"> <StackLayout orientation="vertical"> ...

Error TS2339 occurs when attempting to migrate to TypeScript due to the absence of the 'PropTypes' property on the 'React' type

Currently in the process of converting a javascript/react project to a typescript/react/redux project. Encountering an issue with this particular file: import React from 'react'; import GoldenLayout from 'golden-layout'; import {Provi ...

A step-by-step guide on leveraging swagger-autogen in TypeScript applications

Is it possible to integrate the swagger-autogen module into a Typescript project? I have attempted multiple methods, but have been unsuccessful. The error message "Failed" keeps appearing when using a swagger.js file: const swaggerAutogen = require("swagge ...