Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

340
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!