So your Angular application won't run and you notice something like "Type xxx does not have 'emod' property" in the Developer Console?

Okay. You're not alone.

In fact, if you try to search for that problem by typing in the error, you'll notice that the search engine helpfully autocompletes it for you. So plenty of others have experienced a similar issue.

But alas, the search results don't help.

That's why I'm here.

I'll help.

Because I love you.

It's an Import Thing

Let's cut to the chase: you're probably importing a module that's not a module.

And Angular doesn't like that.

If you're using Angular Material, for example, and you want to use MatTable to display a table on the screen, you might have imported MatTable in one of your modules like so:

@NgModule({
  declarations: [
//whatever 
  ],
  exports: [
//whatever, cont.
  ],
  imports: [
    MatDatepickerModule,
    MatExpansionModule,
    MatTable,
    RouterModule.forChild(routes)
  ]
})

You see that MatTable in there? That's not a module.

You can't import that.

What you probably want to do in that situation is import MatTableModule instead of MatTable.

Try that and I think you'll find that the error goes away.

It's Not Just for Angular Material

But you won't just see the problem if you're using Angular Material. You can see that problem if you ever try to import anything that isn't a module.

So if you're suddenly seeing that "does not have 'emod' property" error, think about what you just added to the imports array in one of your modules.

That's likely the culprit.

Eliminate that import and try again. Your application will probably run just fine.

Wrapping It Up

Not sure why nobody bothered to post about this before me since it's such a popular search topic. But I'm happy to help.

Now you know how to fix that problem. And once you've fixed it, you can get back to the fun stuff of developing software solutions.

Have fun!

Photo by Charles Parker from Pexels