Angular 2 Webpack Modules Issue - Build fails because of a base class -
i'm having issue loading angular 2 application after i've moved few components 1 module another. guess i'm doing wrong in code error i'm getting not helpful , don't know if it's issue angular or webpack.
error when loading application:
uncaught typeerror: object prototype may object or null: undefined @ setprototypeof (<anonymous>) that error i'm getting when application loaded. know issue somehow related services in application i'm not sure happening. application failing:
what has caused issue?
i have 4 modules within application:
- appmodule
- coremodule
- sharedmodule
- featuremodule
it aim follow angular guidelines regards modules. had set above listed modules while ago , noticed using coremodule incorrectly. apart providing services used in application had put "generic"/"reusable" components in module well.
after reading faqs specifically feature modules set moving these components sharedmodule. of these components make use of services in coremodule. once moved these components sharedmodule , updated necessary code began encounter issue.
currently modules have set in following way:
- appmodule imports necessary modules along coremodule , featuremodule
- coremodule provides services used in application
- sharedmodule declares , exports generic components
- featuremodule declares components used in specific feature
i'm not sure if i'm importing wrong module in wrong place, can't figure out why i'm getting error because moved component 1 module another. can't understand error making difficult me understand wrong.
setup versions:
- angular: 4.0.1
- webpack: 2.3.3
- typescript: 2.2.2
further investigation
as mentioned above current setup have of services being used across whole application in 1 coremodule (core folder). components using these services in sharedmodule (shared folder). when these components resided in same module , folder working expected.
now when moved these components in sharedmodule, @ first getting errors described here had encountered before , changed imports have reference service directly instead of barrel. once changed these imports error shown above. again lost problem is, can't understand error , change i've done components moved folder , module services reside. suspicion somehow circular dependency created, i'm not sure.

Comments
Post a Comment