How to find the reason of "Cannot find module" for nrwl modules?

how to find a reason to live reddit
find a reason to live quotes
trying to find a reason to stay

I use nrwl.io in my project.

I created several libs:

ng g lib rest //ok
ng g lib services //ok
ng g lib models //created ok, but "Cannot find module " later on!

All of these libs were successfully created, but when I try to import my models lib I see error "Cannot find module":

import { ModelA, ModelB } from '@myproj/models'; //Cannot find module '@myproj/models'

The question is: How and where I can check if my '@myproj/models' was properly registered?

P.S. I can see "models" module in nx.json, angular.json and tsconfig.json. And I can see no difference with other modules.

P.P.S. I use "@nrwl/nx": "6.1.0" and "@nrwl/schematics": "6.1.0"

I also had the same issue. Created a library and tried to use it in multiple projects. First make sure your library is added in main tsconfig.json -> paths property.

"paths": {
  "@projectName/LibraryName1": ["libs/LibraryName1/src/index.ts"],
  "@projectName/LibraryName2": ["libs/LibraryName2/src/index.ts"],
  ....
}

Then you must have your project added in your main angular.json file.

"projects": {
   "LibraryName1": {
   "root": "libs/LibraryName1",
   "sourceRoot": "libs/LibraryName1/src",
   "projectType": "library",
   "prefix": "projectName",
   "projectType": "library"
   ...
  }
}

Then obviously check tsconfig.json file for that app in which you are going to use lib. The key is to remove paths property. Because you already added in main tsconfig.json (in my case I used nrwl (a technique for managing multiple apps)).

Now you should be able to reference any of your lib projects like so :

import { class1,class2 } from '@projectName/libraryName1';

Don't forget to export your classes (assuming you have models library ) using index.ts like so :

export * from './lib/class1';
export * from './lib/class2';

Or If you have any UI library that have components. You should create a module add those components in it and then export it using index.ts The module file should be in lib folder. e.g

import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { NumberOnlyDirective } from './directives/number-only.directive';

@NgModule({
imports: [CommonModule],
declarations: [NumberOnlyDirective],
exports: [NumberOnlyDirective]
})
export class UiModule {}

index.ts file for UI library

export * from './lib/ui.module';

Add UI module's reference in your project app.module.ts

import { UiModule } from '@projectName/LibraryName1';

in imports also

 imports: [
BrowserModule,
FormsModule,
ReactiveFormsModule,
HttpClientModule,
NgxPaginationModule,
Ng2OrderModule,
Ng2SearchPipeModule,
AngularEditorModule,
RichTextEditorAllModule,
NgxPrintModule,
DevExpressModule,
UiModule
...
],

How to find a reason to live, But you will certainly get to the other side and find out you where wrong. And you will enjoy it. To know what it feels to love and feel loved. In a mature way. With no​  English Language Learners Definition of reason. (Entry 1 of 2) : a statement or fact that explains why something is the way it is, why someone does, thinks, or says something, or why someone behaves a certain way. : a fact, condition, or situation that makes it proper or appropriate to do something, feel something, etc.

This is where using --parent-module=apps/myapp/src/app/app.module.ts comes in when creating a lib.

One of the things that flag does is modify the tsconfig.app.json and adds "../../libs/mylib/src/index.ts to the includes which tells TS to use the module.

How to Find Your 'Reason For Waking Up In the Morning', How to Find Your 'Reason For Waking Up In the Morning'. May 13, 2016 • Eric Stewart. Reason for which you wake up. It's not an easy question to answer. Once you find your personal purpose, you’ll be able to create the personal brand. Finding Your Why: How to Discover Your Professional Purpose. The two most important days in your life are the day you are born and the day you find out why. – Mark Twain. How I discovered my professional purpose

Find a reason definition and meaning, Find a reason definition: The reason for something is a fact or situation which explains why it happens or what | Meaning, pronunciation, translations and  To know the reason for rejection of your claim you have to visit EPF claim status portal. If your claim was settled then there you can find the amount of claim settled and date of claim settlement. For every rejected PF form 19 and 10C claims, you can find the reason of claim rejection at EPF claim status portal.

Life Purpose, Life Purpose - How To Find Your Reason For Living: How To Find Your Reason For Living - Kindle edition by Claire Perkins. Download it once and read it on  Waiting, hoping and wishing seldom have a place in the vocabulary of positive individuals. Rather, they use strong words that are pro-active and not reactive. Passivity leads to a lack of involvement, while positive people get very involved in constructing their lives. They work to make changes to feel better in tough times rather than wish

Life Purpose: How To Find Your Reason For Living: Claire H Perkins , Life Purpose: How To Find Your Reason For Living [Claire H Perkins] on Amazon​.com. *FREE* shipping on qualifying offers. This little book is a positive  I was outbid on an auction. Then the person who bid retracted their bid. Then I received an email from ebay saying, "You can view the retraction/cancellation and the reason provided by selecting the (bid history) link from the individual item page." When I go to that link, I see the bid retraction b

Ikigai - Your Reason for Being, To find it often requires deep enquiry and lengthy 'search of self' – a In Okinawa, Japan, ikigai is thought of as “a reason to get up in the  Find Event Viewer and Click it. To access Event Viewer in Windows Vista, and Windows 7: Click the Start Button. Click Control Panel. Click System and Security. Click Administrative Tools. Click Event Viewer. To access Event Viewer in Windows 8: Hit the Windows Key. Type in “View Events”. Hit enter.

Comments
  • You can try the --traceResolution option to tsc, though this won't tell you about Angular-specific module resolution behavior if there is any (which I'm not familiar with).
  • Have you found any fix to this?
  • @SCRATK I don't really remember now, but I guess no. I just re-built project from scratch and it works