Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

259
Visualizações
Why getting 404 error in routing in next.js?

I have a Next.js application.Initially the homepage is loaded to the user and after a timer of 10 the user has to be redirected to a feedback page:

 const router=useRouter();
 if(timer==0)
  {
    router.push('/feedback');
    clearTimeout(time);
  }

However at the time of routing to feedback page , Im getting the following error:

404
This page could not be found.

Feedback page:

import type { NextPage} from 'next'
import Head from 'next/head'
import Image from 'next/image'
import styles from '../styles/Home.module.css'
import {useState} from 'react'
const Feedback: NextPage=()=>{
    const [name,setName]=useState("");
    const [email,setEmail]=useState("");
    const handleSubmit=(e)=>{
        e.preventDefault();
        console.log(name);
        console.log(email);

    }
    return(
        <form onSubmit={(e)=>handleSubmit(e)}>
        <div>
        <label htmlFor="name">Name</label>
        <input
          type="text"
          id="name"
          value={name}
          onChange={(e) => setName(e.target.value)}
        />
        </div>
        <div>
        <label htmlFor="email">Email</label>
        <input
          type="text"
          id="email"
          value={email}
          onChange={(e) => setEmail(e.target.value)}
        />
        </div>
      </form>
    )
}

export default Feedback;

Inspite of having a feedback page in the pages folder, Im getting this error.

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda