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

322
Views
Recibí el error "Error en la optimización de compilación: página encontrada sin un componente React como exportación predeterminada en páginas/" Ayúdame

En modo desarrollador funcionó muy bien. Más tarde en CMD, envié "npm run build. Obtuve un error...

 info - Checking validity of types info - Creating an optimized production build info - Compiled successfully > Build optimization failed: found pages without a React Component as default export in pages/js/TimeClock pages/js/ChangePage

Traté de arreglarlo. Nada en Internet ayudó. Aquí están mis archivos:

índice.js

 import Head from 'next/head' import Time from './js/TimeClock.page'; import { ChangePage0, ChangePage1, ChangePage2 } from './js/ChangePage.page'; export default function Home() { ... }

RelojTiempo.page.js

 import ReactDOM from 'react-dom' export function tick() { const site = ( <div> <span className="time"> {new Date().toLocaleTimeString()} </span> </div> ); ReactDOM.render(site, document.getElementById('time')); } setInterval(tick, 1000);

siguiente.config.js

 /** @type {import('next').NextConfig} */ const nextConfig = { reactStrictMode: true, } module.exports = { pageExtensions: ['page.tsx', 'page.ts', 'page.jsx', 'page.js'], nextConfig }
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

No estoy seguro de entender lo que está tratando de hacer con setIinterval en un componente, pero probablemente necesite exportar el valor predeterminado en lugar de una exportación de nombres.

En TimeClock.page.js

 function Tick() { ... } export default Tick;
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!