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

136
Visualizações
Next js jQuery with java script constructor functions

I have this flow of files.

enter image description here

In container.jsx component I import the udf-compatible-datafeed.js file like this

_createChart(){
 const UDFCompatibleDatafeed = (await import("./datafeeds/udf/src/udf-compatible-datafeed")).default;
}

This import failed and this gives me an error

Error: jQuery was not found. Please ensure jQuery is referenced before the SignalR client JavaScript file.

The error comes from this data-pluse-provider file

import { logMessage, } from './helpers';
import $ from 'jquery';

require('signalr');
window.jQuery = $;

const DataPulseProvider = function(){};

export {DataPulseProvider}

This file requires jQuery. I think due to SSR reasons. window object may not be defined here. I can't use nextjs dynamic imports here as well. Because this is a JavaScript file, not a jsx component.

But from the index.jsx component I import the component with next js dynamics and for the ContainerPage as well. But the error is still there.

How can I fix this with next.js? Any help!

Thanks in advance.

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