core-js & RegExp error All In One [How to Solve]

core-js & RegExp error All In One

Module not found: Error: Can’t resolve ‘core-js/modules/es.regexp.dot-all.js’

error
Use regular constructor

check (objString = '{}') {
    const result = JSON.stringify(obj).replace(new RegExp(/%/, 'g'), '%%');
},

Solution:

Use regular literals instead of regular constructors

check (objString = '{}') {
    const result = JSON.stringify(obj).replace(/%/g, '%%');
},

Similar Posts: