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

399
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
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