#879·RecordRTC

TypeError: Cannot set property navigator of # which has only a getter

Author: giulianopenidoCreated Aug 14, 2024Updated Dec 10, 2024

I am facing an issue to build an nextjs project using RecordRTC. Just importing the package I receive this error below

TypeError: Cannot set property navigator of # which has only a getter

Looking into the source code, the problem seems to be from this snippet:

// RecordRTC.js at 1586 line
global.navigator = {
  userAgent: browserFakeUserAgent,
  getUserMedia: function() {}
};