I\'m setting up webpack to my react project using yarn and this error appears:
ERROR in ./src/app.js 67:6 Module parse failed: Unexpected token (67:6) Y
You are using unnecessary escape character: which is not required.
Replace test: '/\.(js|jsx)$/', with test: /\.js$|jsx/, it should work fine.
test: '/\.(js|jsx)$/',
test: /\.js$|jsx/,
I replicated your issue in my machine and found the same which is resolved by the above fix.
hope this helps, happy coding!!!