formio / formio.js

JavaScript powered Forms with JSON Form Builder

Home Page:https://formio.github.io/formio.js

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Uncaught TypeError: Cannot add property initialized, object is not extensible

j-perl opened this issue · comments

Hi,

We're currently using formiojs (4.12.1) and react-formio (4.3.0) and we're trying to update these dependencies to the latest stable versions (4.17.2 and 5.2.3 respectively at the time of this writing), however, when displaying a form, we're getting this error, which comes from this piece of code :

https://github.com/formio/formio.js/blob/22b32cfadbbb02bcdc919403951bcaecca0c2202/src/Webform.js#L339C3-L366

Apparently, modifications are made to the i18next object that is not extensible.

In strict mode, attempting to add new properties to a non-extensible object throws a TypeError.

Strangely enough, I couldn't find any thread mentioning this issue so I'm wondering whether we are not the only one having it. Do you have any idea what I could be doing wrong?

For those having the same problem, I've found that importing and passing our own instance of i18next through the options parameter makes the problem go away.