Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

383
Views
Next.js Components: Error: error: Return statement is not allowed here

I am running into an error when I add a new component into my Next.js Project where it gives the following:

`./components/GridMember.js Error: error: Return statement is not allowed here

| 6 | return (test); | ^^^^^^^^^^^^^^^^^^^^^^^^^

Caused by: 0: failed to process js file 1: error was recoverable, but proceeding would result in wrong codegen 2: Syntax Error`

[error][1] [1]: https://i.stack.imgur.com/PU5z5.png

I am unsure what is causing this as I should be able to return what I have. I have pasted the code below to the component

`import styles from './GridMember.module.css'

export default GridMember()
{
    return (<div>test</div>);
}`

and then the page has the following:

`import GridMember from "../components/GridMember";

export default function Work()
{
    return(
    <div>WORKING
        <GridMember/>
    </div>
    );
}`

Any suggestions are appreciated!

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

you are missing function so you must write the code like this

import styles from './GridMember.module.css'


export default function GridMember()
{
    return (<div>test</div>);
}
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!