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

392
Vistas
You may need an additional loader to handle the result of these loaders, r = ts(a[0])

I'm using react typescript and simply want to create a select component for a time zone picker. I tried using npm library react-timezone-select. But it is giving the below errors in the console:

index.js:1 ./node_modules/react-timezone-select/dist/esm/index.js 9693:38

Module parse failed: Unexpected token (9693:38)

File was processed with these loaders:

./node_modules/babel-loader/lib/index.js

You may need an additional loader to handle the result of these loaders.

r = ts(a[0]);
let o = "",
s = n.isDST() ? r[0].daylight?.abbr : r[0].standard?.abbr,
l = n.isDST() ? r[0].daylight?.name : r[0].standard?.name;
const u = 60 * t.current.offset,

I can't figure out what am I doing wrong. Can't use npm libraries in react typescript?

I tried installing react-timezone-select using the below commands

npm i react-timezone-select
npm i @types/react-timezone-select

Also, I changed the tsconfig.json file to include

"lib": ["DOM", "ES6", "DOM.Iterable", "ScriptHost", "ES2016.Array.Include", "esnext"],

"include": ["src", "backend", "src/**/*.ts", "src/**/*.tsx"]

but none of it worked and the same error is persistent.

I expected typescript to make life easier but instead, it creates more problems with every other npm library.

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

0

It seems updating the react-scripts to 5.0.1 fixes your problem. Refer to this thread https://github.com/ndom91/react-timezone-select/issues/57

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