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

339
Visualizações
react-app-rewired start works but not build

I have been having an issue with my website where I run "yarn start" and the site runs just fine. When I use the command "yarn build" all my images are placed inside the build folder but it does not add the index or any of the static stuff.

These are my scripts.

"start": "react-app-rewired start",
"build": "react-app-rewired build",
"test": "react-app-rewired test",

When I change the build script to "build": "react-scripts build" I get the error

Cannot find module: 'components/header'. Make sure this package is 
installed.

You can install this package by running: yarn add components/header.

My site uses babel to map these imports

config-overrides.js

const { useBabelRc, override, addWebpackModuleRule } = require('customize-cra');

const isDev = process.env.NODE_ENV === 'development';

module.exports = override(
  useBabelRc(),
  addWebpackModuleRule({
    test: /\.tsx?$/,
    exclude: /node_modules/,
    use: [
      { loader: 'babel-loader' },
      {
        loader: '@linaria/webpack-loader',
        options: {
          cacheDirectory: 'src/.linaria_cache',
          sourceMap: isDev,
        },
      },
    ],
  }),
  addWebpackModuleRule({
    test: /-icon\.svg$/,
    use: ['@svgr/webpack'],
  })
);
module.exports = {
  presets: [['react-app', { flow: false, typescript: true }], '@linaria'],
  plugins: [
    ['@babel/plugin-proposal-private-methods', { loose: true }],
    ['@babel/plugin-proposal-class-properties', { loose: true }],
    [
      'module-resolver',
      {
        root: ['./src'],
        alias: {
          components: './src/components',
          styles: './src/styles',
          assets: './src/assets',
        },
      },
    ],
  ],
};

When I use yarn build as normal it just loads normal and then says done. is their any reason why this works with yarn start and not build?

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