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

767
Visualizações
Module parse failed: Unexpected token - react-refresh-webpack-plugin/loader

I built a react component package locally, with Rollup.

Tech stack of package is: React, typescript, styled-components and so on...

  1. That package lives inside of the one project.

  2. Now I am trying to use that package inside of another project locally.

  3. Now I am trying to test that package

    • yarn link
    • open second project executed yarn link "package-name"
    • Imprted component (package)
    • yarn start

Result:

Failed to compile.

../enrollment-client/src/components/GeneralSectionForm/GeneralSectionForm.tsx 31:7
Module parse failed: Unexpected token (31:7)
File was processed with these loaders:
 * ./node_modules/@pmmmwh/react-refresh-webpack-plugin/loader/index.js
You may need an additional loader to handle the result of these loaders.
| import { TOAST_ERRORS } from '../../utils/constants';
| 
> export type QuestionElementRef = {
|   id: string | undefined;
|   element: HTMLDivElement | null;

got the error regarding that the current webpack configuration inside of the project is not enough to compile this package - something like that.

That is something that I am currently investigating, and trying to figure out why? :)

Any help will be super appreciated

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

I also got the same error message and was stuck. My project looks like the following example.

/cra-project // Frontend UI project(not monorepo root)
 |- /node_modules
 |- /packages
 | |- /value-objects // Local package
 |   |- /src
 |   |  |- index.ts
 |   |  |- ...
 |   |- packages.json
 |- /src
 |  |- index.ts
 |  |- ...
 |- packages.json
 |- tsconfig.json
 |- yarn.lock

The value-objects package was added as symlink to node_modules with yarn add link:./packages/value-objects.

But exec yarn add ./packages/value-objects and copied to the same location did not solve the problem.

So I don't consider this problem (taking the error message seriously) to be caused by react-refresh-webpack-plugin/loader.

I honestly don't know if this is an adequate answer, but why don't you try compiling the enrollment-client package individually?

Doesn't work?

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