Skip to content

Webpack upgrade from v4 to v5 loader errors #18114

Answered by nyngwang
abrahamcuenca asked this question in Q&A
Discussion options

You must be logged in to vote

@abrahamcuenca Could you please try this first: remove your exclude-rule for babel-loader first and see whether the error would disappear:

- exclude: /node_modules|\.test\.jsx?$|\.snap$/,

I suspect that those .jsx tags might not be processed due to this exclusion rule. IIRC, a testing framework might expect to see the older syntax(i.e. not ES6, or it's called CJS, anyway) so you might have to transpile some of your testing files if you're writing in ES6+. (the arrow function in your case implies this.)

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@nyngwang
Comment options

Answer selected by abrahamcuenca
@abrahamcuenca
Comment options

@nyngwang
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants