0

My app works fine in AoT however when switching to JIT, I get:

Uncaught Error: Unexpected value 'undefined' imported by the module 

Sure enough the module is undefined when I set a breakpoint and inspect it. The module that is undefined is imported as such:

import { SharedComponentModule } from '@app/components';

@app/components is defined in a typescript path like so:

...
  "@app/components": [
    "app/core/components/index"
  ],

the barrel that exports the moudle:

...
export { SharedComponentModule } from './shared-component.module';
that_guy
  • 2,313
  • 4
  • 33
  • 46
  • Do you change anything in your tsconfig.json ? you must change compilerOptions in your tsconfig.shon like this [link](https://stackoverflow.com/a/42306860/2585074) – Mohammad Daliri Mar 12 '18 at 19:48
  • Yes I have my baseUrl set to "src" – that_guy Mar 12 '18 at 21:25
  • 1
    Can you provide minimal example of your issue on github? – yurzui Mar 15 '18 at 19:51
  • You need to provide more info like a minimal git repo for one to answer this. I would also look at these threads [this](https://stackoverflow.com/questions/40541311/unexpected-value-undefined-imported-by-the-module) and [this](https://stackoverflow.com/questions/39265561/error-unexpected-value-undefined-imported-by-the-module) – Tarun Lalwani Mar 19 '18 at 13:20
  • Sounds lie you are missing an `export` somewhere. Perhaps _in_ `shared-component.module`. Note that I would suggest that you avoid using so called "barrels". – Aluan Haddad Mar 20 '18 at 19:54

1 Answers1

0

This solution might be refer to this answer

  1. Missing commas at root module component
  2. Double Commas at root module component
  3. Exporting Nothing from the Module
  4. Syntax errors
  5. Typo Errors
  6. Semicolons inside Objects, Arrays
  7. Incorrect import Statements
  8. modules import each other

Mostly problem on root module.

hendrathings
  • 3,720
  • 16
  • 30