I'm rather new to React and now trying to fix an error that occurs at runtime due to a new version of prosemirror.model in our artifactory. The new version is 1.18.1, the old version that works was 1.16.1.
Loading the page gives the following error in console:
Uncaught TypeError: prosemirror_model__WEBPACK_IMPORTED_MODULE_0__.Schema is not a constructor
at Module.../../components/src/20-molecules/rte/config/schema.js (schema.js:122:1)
at __webpack_require__ (bootstrap:781:1)
at fn (bootstrap:149:1)
at Module.../../components/src/20-molecules/rte/index.js (editor.css?e9c4:45:1)
at __webpack_require__ (bootstrap:781:1)
at fn (bootstrap:149:1)
at Module.../../components/src/index.js (index.js:1:1)
at __webpack_require__ (bootstrap:781:1)
at fn (bootstrap:149:1)
at Module../src/containers/edit/edit.js (index.scss?46f0:45:1)
at __webpack_require__ (bootstrap:781:1)
at fn (bootstrap:149:1)
at Module../src/containers/edit/index.js (edit.js:600:1)
at __webpack_require__ (bootstrap:781:1)
at fn (bootstrap:149:1)
at Module../src/App.js (types.js:3:1)
at __webpack_require__ (bootstrap:781:1)
at fn (bootstrap:149:1)
at Module../src/index.js (i18n.js:74:1)
at __webpack_require__ (bootstrap:781:1)
at fn (bootstrap:149:1)
at Object.0 (url.js:251:1)
at __webpack_require__ (bootstrap:781:1)
at checkDeferredModules (bootstrap:45:1)
at Array.webpackJsonpCallback [as push] (bootstrap:32:1)
at main.chunk.js:1:57
Code line that breaks:
export const schema = new Schema({ nodes, marks });
I've tried to find the code to create the Schema instance without constructor, but couldn't identify it. Even the prosemirror guide and code themselves use the constructor to create a Schema object, so I'm quite confused about this. Anyone an idea how to solve this?