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

138
Views
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
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!