Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

174
Vistas
ReactJs in static production: White page "Typeerror: Object(...) is not a function"

I have a ReactJs project that has been testet and works perfectly in development.

I am now trying to host it on an Apache Server on my Ubuntu based VPS. Routing works fine apparently, one simple "about page" is loading fine. But all other routes result in a blank white page, and the following console errors: enter image description here

I suspect something might be wrong with dependencies: An example depency list for a non-working component looks like this:

import { Row, Col } from 'antd';
import { useNavigate } from "react-router-dom";
import BouncingBox from '../../components/bouncing-box/bouncing-box.jsx';
import RoundedBtn from '../../components/rounded-btn/rounded-btn.jsx';
import { Input } from 'antd';
import { useState, useRef } from 'react';
import FirebaseService from '../../services/FirebaseService.js';
import SessionStorageService from '../../services/SessionStorageService.js'
import { useParams } from 'react-router';
import { useEffect } from 'react/cjs/react.development';

Does anyone know what could be causing the issue? It is a project based on create-react-app, so we are using webpack along with some custom libraries. Should be noted that I have tried hosting it on Netlify with the EXACT same result, so probably not a server configuration issue.

EDIT:

join-game.jsx line 27 refers to this code...

 useEffect(() => {
        if (inputstate == 1) isHosting.current = true
    }, [])
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

So the issue for me was the import:

import { useEffect } from 'react/cjs/react.development';

Was auto generated. So I removed the line and I switched:

import { useState, useRef } from 'react';

To:

import { useState, useRef, UseEffect } from 'react';

Moral of the story: You can click the causing issue in dev tools and pretty print it, this will hint the file in which you should likely check your imports.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda