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

318
Visualizações
ReferenceError: regeneratorRuntime is not defined in create-react-app

Currently trying some testing using Jest for the first time on a create-react-app project:

import { render, cleanup } from "@testing-library/react";
import React from "react";
import CarouselItem from "./carousel-item.component";

afterEach(cleanup);

describe("<carousel-item.test />", () => {
    const defaultProps = {};
    const element = render(<CarouselItem {...defaultProps} />);

    test("render", () => {
        expect(element).toMatchSnapshot();
    });
});

But I've been receiving this error when running the test:

ReferenceError: regeneratorRuntime is not defined

      40 |      }, [$title, genreIDs]);
      41 |
    > 42 |      const getInfo = async (id) => {
         |                   ^
      43 |              // get additional title data
      44 |              try {

I have seen a few different answers but none of them pertain specifically to create-react-app projects so I wanted to double check.

Should I just install regenerator-runtime and import it into every file using an async function? The CRA docs and other answers I've seen give the impression that this sort of thing should be polyfilled automatically when using CRA, am I doing something wrong?

TIA

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