Home > Enterprise >  Does anyone know nay fix for this error (TypeError: Cannot assign to read only property 'map�
Does anyone know nay fix for this error (TypeError: Cannot assign to read only property 'map�

Time:02-11

In local working fine but when i deployed on digital ocean Kubernetes server then showing error. please help....

enter image description here

CodePudding user response:

Check your node version. It happening in new version of node.

CodePudding user response:

This is not a kubernetes specific issue. Kubernetes is a docker orchestrator. So you have to modify your dockerfile to use a working node base image.

Also I would recommend to you to not use odd major versions of node, as they are bleeding edge. Best practice is to use LTS-versions for production, to specifically avoid such issues, and those are node versions with even major-version (12, 14, 16...).

If you use node:latest in your dockerfile, than you are using node 17.5, according to dockerhub. And thats why you have issues.

Best practice for node docker images is to pinpoint exact versions down to patch-version. E.g. use 16.14.0-alpine3.15 instead of 16-alpine. Thus also avoiding caching an old node 16 base image in docker and then wondering why you building on a different machine breaks.

https://github.com/Automattic/mongoose/issues/11377

  • Related