lazy loaded module(without router) throws compilation error

98 Views Asked by At

Following articles on medium, I am trying to load one portion of a dashboard as a module.

The first step is to add this module in angular.json under "lazyModules" .

As soon as i add this, i am getting this error -

Module build failed (from ./node_modules/@ngtools/webpack/src/index.js)
Error:PATH_TO_MY_MODULE\lazy-module.ts is missing from Typescript compilation. Please make sure it is in your tsconfig via 'files' or 'include' property.

I have already tried adding this to files/include property. doesnt help.

angular.json

"projects": {
   "my-project": {
       "architect": {
          "build": {
             "options": {
                "lazyModules": { "src/app/lazy-module/lazy-module.module" }
                 "aot": true,
                 "assets": ...
                 ...
              }
           }
        }
     }
}
0

There are 0 best solutions below