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

178
Vistas
JavaScript identify whether this is a valid JS class or not?

I am trying to convert React.js project to a next.js project.

I have this udf-compatible-datafeed.js file

import * as tslib_1 from "tslib";
import { UDFCompatibleDatafeedBase } from "./udf-compatible-datafeed-base";
import { QuotesProvider } from "./quotes-provider";
import { Requester } from "./requester";
var UDFCompatibleDatafeed = /** @class */ (function (_super) {
    tslib_1.__extends(UDFCompatibleDatafeed, _super);
    function UDFCompatibleDatafeed(datafeedURL, intradayFeedUrl, realTimeFeedUrl, enableLogging) {
        var _this = this;
        var requester = new Requester();
        var quotesProvider = new QuotesProvider(datafeedURL, requester);
        _this = _super.call(this, datafeedURL, intradayFeedUrl, realTimeFeedUrl, quotesProvider, requester, enableLogging) || this;
        return _this;
    }
    return UDFCompatibleDatafeed;
})(UDFCompatibleDatafeedBase);
export default UDFCompatibleDatafeed;

Then inside my TVChartContainer.jsx file

 const UDFCompatibleDatafeed = await import("./datafeeds/udf/src/udf-compatible-datafeed.js");
        console.log("UDFCompatibleDatafeed", UDFCompatibleDatafeed);
 console.log("3...");

       

        const widgetOptions = {
            //debug: true,
            symbol: this.props.symbol,
            // BEWARE: no trailing slash is expected in feed URL
            datafeed: new UDFCompatibleDatafeed(
                this.props.datafeedUrl,
                this.props.intradayUrl,
                this.props.realTimeUrl,
                this.props.enableLogging
            ),
            interval: this.props.interval,
           
        };

This is my console logout put

enter image description here

And I am getting an error

TypeError: UDFCompatibleDatafeed is not a constructor

How do we identify whether this is a valid JS class or not?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

I think just removing new will do the trick. you are returning a function, not a class.

datafeed: UDFCompatibleDatafeed(...)
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