Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
bomanimc opened this issue Jul 2, 2024 · 2 comments
Open

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

bomanimc opened this issue Jul 2, 2024 · 2 comments

Comments

@bomanimc
Copy link

bomanimc commented Jul 2, 2024

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;

@camillalo
Copy link

camillalo commented Jul 2, 2024 via email

@bomanimc
Copy link
Author

bomanimc commented Jul 9, 2024

Thank you! Looking forward to your response!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants