Can someone please tell me why the Next.js compiler cannot parse and compile a basic JSX script such as this one?
---- contents of index.js ---- file
const IndexPage = () => {
return {
};
}
export default IndexPage ;
error - ./pages/index.js
Error: error: Unexpected token < (jsx tag start)
. Expected identifier, string literal, numeric literal or [ for the computed key
|
3 |
| ^
The error I get is:
Caused by:
0: failed to process js file
1: Syntax Error
(node:25380) [DEP_WEBPACK_MODULE_ISSUER] DeprecationWarning: Module.issuer: Use new ModuleGraph API
(Use node --trace-deprecation ...
to show where the warning was created)
wait - compiling /_error (client and server)...
error - ./pages/index.js
Error: error: Unexpected token < (jsx tag start)
. Expected identifier, string literal, numeric literal or [ for the computed key
|
3 |
| ^
Caused by:
0: failed to process js file
I am running Next.js v12.1.0 with Node v16.14.0 on a Windows 11 professional machine.
Thanks,
Saad
Top comments (1)
Try this