title: Uncaught TypeError: can't define property "x": Object is not extensible
body: <p>I'm trying to restore a old project written on <code>ReactJS 16.4</code> and packed with <code>webpack 3</code>.
  As for now I've upgraded all libraries, <code>ReactJS</code> to <code>v17</code> and <code>webpack</code> to <code>v5</code>.</p>
  <p>So, I'm getting this error:</p>
  <pre><code>Uncaught TypeError: can't define property &quot;lang&quot;: Object is not extensible
  </code></pre>
  <p>And the code is:</p>
  <pre><code>class LandingPage extends React.Component {
  
    render() {
      const { i18n } = this.props;
  
      if ((typeof this.props.match.params.lng !== 'undefined') &amp;&amp; ((this.props.match.params.lng == 'en') || (this.props.match.params.lng == 'lt'))) {
        this.props.lang = this.props.match.params.lng.toString();
      }
      else {
        this.props.lang = 'lt';
      }
  
      if (this.props.lang !== i18n.language) {
  
        i18n.changeLanguage(this.props.lang, (err) =&gt; {
          if (err) return console.log('something went wrong loading', err)
        });
      }
  
      return (
        &lt;div&gt;
          &lt;Preloader /&gt;
          &lt;Header /&gt;
          &lt;SectionMain /&gt;
          &lt;Footer /&gt;
        &lt;/div&gt;
      )
    }
  }
  </code></pre>
  <p>It's seems that something has changed since that time.
  How it could be fixed?</p>