rspack icon indicating copy to clipboard operation
rspack copied to clipboard

[Bug]: rspack 1.5 cannot find webpack-dev-server/client/progress.js

Open sedghi opened this issue 3 months ago โ€ข 4 comments

System Info

System: OS: macOS 15.6.1 CPU: (16) arm64 Apple M4 Max Memory: 1.83 GB / 64.00 GB Shell: 5.9 - /bin/zsh Binaries: Node: 22.18.0 - ~/.nvm/versions/node/v22.18.0/bin/node Yarn: 1.22.22 - ~/.nvm/versions/node/v22.18.0/bin/yarn npm: 10.9.3 - ~/.nvm/versions/node/v22.18.0/bin/npm bun: 1.2.21 - ~/.bun/bin/bun Browsers: Chrome: 139.0.7258.154 Safari: 18.6 npmPackages: @rspack/cli: ^1.5.0 => 1.5.0 @rspack/core: ^1.5.0 => 1.5.0

Details

After upgrade to rspack 1.5 i'm getting this error

<i> [webpack-dev-server] 404s will fallback to '/index.html'
ERROR in ../../../node_modules/@rspack/dev-server/client/index.js?protocol=ws%3A&hostname=0.0.0.0&port=3000&pathname=%2Fws&logging=info&overlay=%7B%22errors%22%3Atrue%2C%22warnings%22%3Afalse%7D&reconnect=10&hot=true&live-reload=true 20:0-100
  ร— Module not found: Can't resolve 'webpack-dev-server/client/progress.js' in '/Users/alireza/open-source/cornerstone3D.git.worktrees/beta/node_modules/@rspack/dev-server/client'
    โ•ญโ”€[20:60]
 18 โ”‚ import { createOverlay, formatProblem, } from "webpack-dev-server/client/overlay.js";
 19 โ”‚ import socket from "webpack-dev-server/client/socket.js";
 20 โ”‚ import { defineProgressElement, isProgressSupported, } from "webpack-dev-server/client/progress.js";
    ยท                                                             โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
 21 โ”‚ import { log, setLogLevel } from "webpack-dev-server/client/utils/log.js";
 22 โ”‚ import sendMessage from "webpack-dev-server/client/utils/sendMessage.js";
    โ•ฐโ”€โ”€โ”€โ”€

Rspack compiled with 1 error in 317 ms
^C

Reproduce link

No response

Reproduce Steps

  1. Go here https://github.com/cornerstonejs/cornerstone3D
  2. Run yarn install, and then run yarn run example stackAPI.
  3. Open localhost:3000 to see it running.
  4. Upgrade rspack to version 1.5.
  5. Repeat the same steps to see the error.

here is my webpack config

const path = require('path');

const csRenderBasePath = path.resolve('packages/core/src/index');
const csToolsBasePath = path.resolve('packages/tools/src/index');
const csAiBasePath = path.resolve('packages/ai/src/index');
const csLabelmapInterpolationBasePath = path.resolve(
  'packages/labelmap-interpolation/src/index'
);
const csPolymorphicSegmentationBasePath = path.resolve(
  'packages/polymorphic-segmentation/src/index'
);
const csAdapters = path.resolve('packages/adapters/src/index');
const csDICOMImageLoaderDistPath = path.resolve(
  'packages/dicomImageLoader/src/index'
);
const csNiftiPath = path.resolve('packages/nifti-volume-loader/src/index');

module.exports = function buildConfig(name, destPath, root, exampleBasePath) {
  return `
// THIS FILE IS AUTOGENERATED - DO NOT EDIT
var path = require('path')

var rules = require('./rules-examples.js');
var modules = [path.resolve('../node_modules/'), path.resolve('../../../node_modules/')];

const rspack = require('@rspack/core');

module.exports = {
  mode: 'development',
  devtool: 'inline-source-map',
  plugins: [
    new rspack.HtmlRspackPlugin({
      template: '${root.replace(/\\/g, '/')}/utils/ExampleRunner/template.html',
    }),
    new rspack.DefinePlugin({
      __BASE_PATH__: "''",
    }),
    new rspack.CopyRspackPlugin({
      patterns: [
        {
          from:
          '../../../node_modules/dicom-microscopy-viewer/dist/dynamic-import/',
          to: '${destPath.replace(/\\/g, '/') + '/dicom-microscopy-viewer'}',
          noErrorOnMissing: true,
        },
        {
          from:
            '../../../node_modules/onnxruntime-web/dist',
          to: '${destPath.replace(/\\/g, '/')}/ort',
        },
      ],
    }),
  ],
  entry: path.join('${exampleBasePath.replace(/\\/g, '/')}'),
  output: {
    path: '${destPath.replace(/\\/g, '/')}',
    filename: '${name}.js',
  },
  module: {
    rules,
  },
  experiments: {
    asyncWebAssembly: true
  },
  externals: {
    "dicom-microscopy-viewer": {
      root: "window",
      commonjs: "dicomMicroscopyViewer",
    },
  },
  resolve: {
    alias: {
      '@cornerstonejs/core': '${csRenderBasePath.replace(/\\/g, '/')}',
      '@cornerstonejs/tools': '${csToolsBasePath.replace(/\\/g, '/')}',
      '@cornerstonejs/ai': '${csAiBasePath.replace(/\\/g, '/')}',
      '@cornerstonejs/polymorphic-segmentation': '${csPolymorphicSegmentationBasePath.replace(
        /\\/g,
        '/'
      )}',
      '@cornerstonejs/labelmap-interpolation': '${csLabelmapInterpolationBasePath.replace(
        /\\/g,
        '/'
      )}',
      '@cornerstonejs/nifti-volume-loader': '${csNiftiPath.replace(
        /\\/g,
        '/'
      )}',
      '@cornerstonejs/adapters': '${csAdapters.replace(/\\/g, '/')}',
      '@cornerstonejs/dicom-image-loader': '${csDICOMImageLoaderDistPath.replace(
        /\\/g,
        '/'
      )}',
    },
    modules,
    extensions: ['.ts', '.tsx', '.js', '.jsx'],
    fallback: {
      fs: false,
      path: require.resolve('path-browserify'),
      events: false
    },
  },
  devServer: {
    hot: true,
    open: false,
    port: ${process.env.CS3D_PORT || 3000},
    historyApiFallback: true,
    allowedHosts: [
      '127.0.0.1',
      'localhost',
    ],
  },
};
`;
};

sedghi avatar Aug 27 '25 13:08 sedghi

Hello @sedghi, sorry we can't investigate the problem further without reproduction demo, please provide a repro demo by forking rspack-repro, or provide a minimal GitHub repository by yourself. Issues labeled by need reproduction will be closed if no activities in 14 days.

github-actions[bot] avatar Aug 27 '25 13:08 github-actions[bot]

I think i have provided the link to the repo that reproduces it

sedghi avatar Aug 27 '25 14:08 sedghi

Sorry, where is the link?

Image

chenjiahan avatar Aug 27 '25 14:08 chenjiahan

sorry forgot to put the link to the my repo. Have not try with the minimal repo

sedghi avatar Aug 27 '25 14:08 sedghi