0

I have deployed an angular app via azure devops in production mode. But when want to go any lazyloaded component it give the error

    ERROR Error: Uncaught (in promise): Error: Cannot find 'default' in 
    './problem/problem.module'
    Error: Cannot find 'default' in './problem/problem.module'

Note that if i reload any page without index.html it gives error:

    The resource you are looking for has been removed, had its name 
    changed, or is temporarily unavailable.

the website is :https://tritronfront.azurewebsites.net/ To produce the error you have to click on problem menu on navbar.

My lazy loading route code is

    { path: 'admin', loadChildren: './admin/admin.module'},
    { path: 'problem', loadChildren: './problem/problem.module'}

and module code is

    export default class ProblemModule { }

1 Answer 1

2

just say:

export class ProblemModule { }

you have to also add one more thing:

{ path: 'problem', loadChildren: './problem/problem.module#ProblemModule'}

This is there in the official documentation https://angular.io/docs/ts/latest/guide/router.html

Sign up to request clarification or add additional context in comments.

2 Comments

it didn't fix my problem. even applying your method triggered the problem in my local machine build version also
thank you it worked . But when i do reload tritronfront.azurewebsites.net/login this page then it give error message The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.