Cannot find module 'core-js/modules/es6.regexp.split'
See original GitHub issue🐛 Bug Report
Using any of the modules provided my core-js/packages
returns this error. Jest targets the old structure of core-js

To Reproduce
yarn add core-js -D
defineStack.js
const defineStack = (stack) => {
// Converting the exisiting string trace into an array
stack = stack.split('\n');
// Removing the first 2 elements of the array
for (let i = 0; i < 3; ++i) {
stack.shift();
}
// Returning the value of this.stack to the required stack trace
return stack.join('\n').trim();
}
export default defineStack;
_tests_/defineStack.js
import defineStack from '../defineStack';
test('trims the stack and returns proper information', () => {
console.log(defineStack);
});
Expected behavior
The tests should pass and log the function definition
Run npx envinfo --preset jest
System:
OS: macOS 10.14.4
CPU: (12) x64 Intel(R) Core(TM) i7-8850H CPU @ 2.60GHz
Binaries:
Node: 10.15.0 - /usr/local/bin/node
Yarn: 1.16.0 - ~/.yarn/bin/yarn
npm: 6.9.0 - ~/.npm-packages/bin/npm
npmPackages:
jest: ^24.8.0 => 24.8.0
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (2 by maintainers)
Top Results From Across the Web
This dependency was not found: * core-js/modules/es6.regexp ...
This dependency was not found: * core-js/modules/es6.regexp.split ... Does anyone know how to resolve this? javascript · vue.js.
Read more >re — Regular expression operations — Python 3.11.1 ...
This module provides regular expression matching operations similar to those found in Perl. Both patterns and strings to be searched can be Unicode...
Read more >RegExp.prototype[@@split]() - JavaScript - MDN Web Docs
Integer specifying a limit on the number of splits to be found. The [@@split]() method still splits on every match of this RegExp...
Read more >Regex.Split Method (System.Text.RegularExpressions)
Splits an input string into an array of substrings at the positions defined by a regular expression match.
Read more >Perl split - to cut up a string into pieces
split REGEX, STRING, LIMIT where LIMIT is a positive number. This will split the the STRING at every match of the REGEX, but...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@AmaanKulshreshtha Babel currently assumes you are using corejs@2. You should be able to add
corejs: 3
to your@babel/preset-env
options to fix this 😃e.g.
We need babel to have test coverage and mocks, which is why it’s on by default.
You need it to live at the top level of
node_modules
. It being hoisted by the package manager is an implementation detail.Jest has bundled babel-jest for ~10 versions
That said, this issue is about babel configuration, it’s not an issue with Jest.