Skip to content

npm run build doesn't exit after successful completion #658

@bomanimc

Description

@bomanimc

Hi all!
I am noticing that the npm run build command doesn't always exit after successful completion of the build, which causes timeout failures while using this approach in CI. This is typically replicable locally (although it seems that it occasionally does exit) , but seems to be consistently replicable in CI.

Any insights on what way cause this issue?

Using [email protected] and [email protected]. Scripts in package.json are set up following the documentation.

 "scripts": {
    "build": "react-app-rewired build",
    "eject": "react-scripts eject",
    "start": "react-app-rewired start",
    "test": "react-app-rewired test"
  },

It seems that the builds are completing properly, but, typically, the command doesn't exit. Here's a screenshot of the terminal output:
Screenshot 2024-07-02 at 2 04 29 PM

My config override looks something like this:

...

const override = (config, env) => {
  config.watch = env !== 'production';
  config.module.rules = [
    {
      generator: {
        filename: ({ filename }) =>
          /[\\/]favicon\.ico$/.test(filename) ? "[name][ext]" : "[hash][ext]",
      },
      test: /\.(gif|ico|jpg|mp3|otf|png|svg|riv|woff2?)$/,
      type: "asset/resource",
    },
    {
      generator: {
        filename: "[path][hash][ext][query]",
      },
      include: SRC_DIR,
      test: [
        // Keep Lottie files out of JavaScript bundles.
        /[\\/]lottie[\\/](.+)\.json$/,
        /[\\/]rive[\\/](.+)\.riv$/,
        /\.(gif|jpg|mp3|otf|png|svg|woff|woff2?)$/,
      ],
      type: "asset/resource",
    },
    {
      loader: "style-loader",
      test: /\.s?css$/,
    },
    {
      loader: "css-loader",
      test: /\.css$/,
    },
    
    ...

    {
      loader: "ts-loader",
      test: /\.tsx?$/,
    },
  ];
  return config;
};

module.exports = override;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions