Cannot find module 'src/app/product/product.module'
See original GitHub issueThank you for writing this. Very handy indeed 😃
Angular CLI: 7.3.6
Node: 11.12.0
OS: darwin x64
Angular: 7.2.10
... animations, common, compiler, compiler-cli, core, elements
... forms, http, language-service, platform-browser
... platform-browser-dynamic, router, service-worker
Package Version
------------------------------------------------------------
@angular-devkit/architect 0.13.6
@angular-devkit/build-angular 0.13.6
@angular-devkit/build-ng-packagr 0.13.6
@angular-devkit/build-optimizer 0.13.6
@angular-devkit/build-webpack 0.13.6
@angular-devkit/core 7.3.6
@angular-devkit/schematics 7.3.6
@angular/cdk 7.3.5
@angular/cli 7.3.6
@angular/flex-layout 7.0.0-beta.24
@angular/material 7.3.5
@angular/pwa 0.13.6
@ngtools/json-schema 1.1.0
@ngtools/webpack 7.3.6
@schematics/angular 7.3.6
@schematics/update 0.13.6
ng-packagr 4.7.1
rxjs 6.4.0
typescript 3.2.4
webpack 4.29.0
Here’s my module:
import {NgModule} from '@angular/core';
import {LandingComponent} from './landing/landing.component';
import {SharedModule} from '../shared/shared.module';
@NgModule({
declarations: [LandingComponent],
bootstrap: [LandingComponent],
imports: [
SharedModule
]
})
export class ProductModule { }
I followed your instructions. I registered a lazyModule in my project under options:
"lazyModules": [
"projects/booking-engine/src/app/product/product.module"
]
I loaded the module like so:
LoadableModule.forRoot({
appDir: 'src/app/',
fileMappings: {
product: 'src/app/product/product.module#ProductModule'
}
})
I tried to load the module using your directive and your service but both return an error.
Cannot find module 'src/app/product/product.module'
FYI My project is a web component using Angular Elements.
Please let me know your thoughts.
Issue Analytics
- State:
- Created 4 years ago
- Comments:10 (5 by maintainers)
Top Results From Across the Web
1 - Stack Overflow
app/product-detail.component.ts(2,22): error TS2307: Cannot find module './product'. I saw many answer but didn't worked for me.
Read more >error ts2307: cannot find module or its corresponding type ...
I am having SOMETIMES an issue message when I run the command "npm run build:xxx" happens randomly.. ERROR in src/app/framework/services/svg2image/svg-to-image.
Read more >Cannot find module 'X' Error in TypeScript | bobbyhadz
The "Cannot find module or its corresponding type declarations" error occurs when TypeScript cannot locate a third-party or local module in our project....
Read more >Cannot find module '@angular-devkit/build-angular ... - YouTube
... occurred: Cannot find module '@angular-devkit/build-angular/package.json'The above exception while running an angular app can be handl.
Read more >How to fix Error: cannot find module "webpack" - Educative.io
Solution · 1. Install webpack in the local app folder · 2. Link webpack to your project.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thank you @mohammedzamakhan! Works like a charm 😃
Yeah it works for me