pcui
pcui copied to clipboard
@babel/helper-regex missing
Just tried to build via webpack
and the result is:
npm i @babel/helper-regex
fixes this, not sure why it seems to work for others 🤔
Hmm. I just built it and I don't see this error. Also there is no @babel/helper-regex
module in my node_modules
folder.
From your log, it looks like @babel/helper-create-regexp-features-plugin
module is requiring it. I have that module, but it doesn't require it. In my case it is version 7.12.13. Maybe you could check there.
@kungfooman Did you ever figure out what was going on with this?
@kungfooman Did you ever figure out what was going on with this?
I never figured it out, the source code is here: https://github.com/babel/babel/blob/master/packages/babel-helper-regex/src/index.js
import pull from "lodash/pull";
export function is(node: Object, flag: string): boolean {
return node.type === "RegExpLiteral" && node.flags.indexOf(flag) >= 0;
}
export function pullFlag(node: Object, flag: string) {
const flags = node.flags.split("");
if (node.flags.indexOf(flag) < 0) return;
pull(flags, flag);
node.flags = flags.join("");
}
It checks on AST level if there is a RegEx with a certain modifier flag (like g or m), but it still puzzles me why only my installation would require that.
The "solution" was also simple enough, so I guess we can just close it.