Angular CLI ERROR in Cannot read property 'loadChildren' of null

前端 未结 11 2302
青春惊慌失措
青春惊慌失措 2021-01-01 12:24

I\'m converting a project to use angular cli and everything is working (once it\'s build) but i\'ve got a weird behaviour during build.

with ng serve I

11条回答
  •  情深已故
    2021-01-01 13:12

    I had this issue after serving my app and resolved it by pressing Ctrl+s in a file that was not even in an edited/unsaved state. Now it compiles without the warning. However, to get it to compile the first time was something very odd.

    Storing an object instance in a variable and setting that variable as my [lazyLoaded] route's data was unacceptable to the TS/NG compiler. However, instantiating the object directly on the route's data property was acceptable.

    I'm well aware that none of the above makes any intuitive sense, whatsoever, but I hope this saves somebody the time it could take to find this on your own.

提交回复
热议问题