I have done project build using command ng build --prod
. It generate successfully build but this build not able to run on live server, It gives following error:-
main.0769518151819531d924.js:1 ERROR Error: Uncaught (in promise): TypeError: Cannot read property 'hasOwnProperty' of undefined
TypeError: Cannot read property 'hasOwnProperty' of undefined
at v (main.0769518151819531d924.js:1)
at Mf (main.0769518151819531d924.js:1)
at t.get (main.0769518151819531d924.js:1)
at kt (main.0769518151819531d924.js:1)
at Pt (main.0769518151819531d924.js:1)
at Et (main.0769518151819531d924.js:1)
at main.0769518151819531d924.js:1
at main.0769518151819531d924.js:1
at Df (main.0769518151819531d924.js:1)
at Mf (main.0769518151819531d924.js:1)
at P (polyfills.7d30aceca8fe7a5b6974.js:1)
at P (polyfills.7d30aceca8fe7a5b6974.js:1)
at polyfills.7d30aceca8fe7a5b6974.js:1
at e.invokeTask (polyfills.7d30aceca8fe7a5b6974.js:1)
at Object.onInvokeTask (main.0769518151819531d924.js:1)
at e.invokeTask (polyfills.7d30aceca8fe7a5b6974.js:1)
at t.runTask (polyfills.7d30aceca8fe7a5b6974.js:1)
at g (polyfills.7d30aceca8fe7a5b6974.js:1)
at t.invokeTask [as invoke] (polyfills.7d30aceca8fe7a5b6974.js:1)
at m (polyfills.7d30aceca8fe7a5b6974.js:1)
{}
on whichhasOwnProperty
is applied – TorietoriihasOwnProperty
. Wherever you usehasOwnProperty()
function, first you should check whether that object exists or not (i.e. it is initialized or not). – Census