I was uploading my proect from Github to Vercel, and I keep getting this error.
ERROR in ./src/index.tsx
Module build failed (from ./node_modules/babel-loader/lib/index.js):
SyntaxError: /vercel/path0/src/index.tsx: Support for the experimental syntax 'jsx' isn't currently enabled (8:3):
6 |
7 | ReactDOM.render(
> 8 | <React.StrictMode>
| ^
9 | <ThemeProvider theme={theme}>
10 | <CssBaseline />
11 | <App />
Add @babel/preset-react (https://git.io/JfeDR) to the 'presets' section of your Babel config to enable transformation.
If you want to leave it as-is, add @babel/plugin-syntax-jsx (https://git.io/vb4yA) to the 'plugins' section to enable parsing.
at Parser._raise (/vercel/path0/node_modules/@babel/parser/lib/index.js:476:17)
at Parser.raiseWithData (/vercel/path0/node_modules/@babel/parser/lib/index.js:469:17)
at Parser.expectOnePlugin (/vercel/path0/node_modules/@babel/parser/lib/index.js:3820:18)
at Parser.parseExprAtom (/vercel/path0/node_modules/@babel/parser/lib/index.js:12577:18)
at Parser.parseExprSubscripts (/vercel/path0/node_modules/@babel/parser/lib/index.js:12149:23)
at Parser.parseUpdate (/vercel/path0/node_modules/@babel/parser/lib/index.js:12129:21)
at Parser.parseMaybeUnary (/vercel/path0/node_modules/@babel/parser/lib/index.js:12104:23)
at Parser.parseMaybeUnaryOrPrivate (/vercel/path0/node_modules/@babel/parser/lib/index.js:11901:61)
at Parser.parseExprOps (/vercel/path0/node_modules/@babel/parser/lib/index.js:11908:23)
at Parser.parseMaybeConditional (/vercel/path0/node_modules/@babel/parser/lib/index.js:11878:23)
webpack 5.84.1 compiled with 1 error in 294 ms
Error: Command "CI='false' npm run build" exited with 1
BUILD_UTILS_SPAWN_1: Command "CI='false' npm run build" exited with 1
I tried different solution I found online but to no avail. What should I do?