Error: Unexpected value 'undefined' imported by the module

前端 未结 30 1931
礼貌的吻别
礼貌的吻别 2020-12-01 03:51

I\'m getting this error after migrating to NgModule, the error doesn\'t help too much, any advice please?

Error: Error: Unexpected value \'undefined\' import         


        
30条回答
  •  北荒
    北荒 (楼主)
    2020-12-01 04:49

    I was facing the same problem. Issue was that I was importing some class from index.ts

        import {className} from '..shared/index'
    

    index.ts contain the export statement

        export * from './models';
    

    I changed it to the .ts file which contain the actual class object

        import {className} from '..shared/model'
    

    and it resolved.

提交回复
热议问题