Reputation: 11
I'm having an Ang12 project with a custom component in a github repo, and i'm trying to use it in another project but i'm having the following error at runtime: Cannot read properties of undefined(reading emod). the npm i git@github:.../house-building.git and ng build,serve are working properly, but im having this error when i m using the component from git in the current project: my-current-project.html:
<house-building></house-building>
does anyone tried to do this and had this error?
Upvotes: 1
Views: 3477
Reputation: 569
I encountered same problem. Currently, I have to use the production config to resolve this problem. If you have a perfect resolution, tell me.
Here is my solution:
In angular.json
set optimization
to true
"development": {
"buildOptimizer": false,
"optimization": true, // resolve the problem of (reading emod)
"vendorChunk": true,
"extractLicenses": false,
"sourceMap": true,
"namedChunks": true
}
Upvotes: 1