webpack-contrib / webpack-hot-middleware

Webpack hot reloading you can attach to your own server

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

webpack-hot-server-middleware on demand loading bug

ygs-code opened this issue · comments

  • Operating System: windos
  • Node Version: v16.15.1
  • NPM Version: 8.7.0
  • webpack Version: "4.46.0",
  • ${package} Version:

Expected Behavior

Actual Behavior

Code

  // webpack.config.js
  // If your bitchin' code blocks are over 20 lines, please paste a link to a gist
  // (https://gist.github.com).
  // additional code, HEY YO remove this block if you don't need it

How Do We Reproduce?

React-loadable and /webpack-hot-middleware make errors when they are used together
Error: Cannot find module './static/js/0.js'
Require stack:

  • K:\react-loading-ssr\dist\server\static\js\main.js
  • K:\react-loading-ssr\node_modules\webpack-hot-server-middleware\src\index.js
  • K:\react-loading-ssr\server\middleware\webpackHot\index.js
  • K:\react-loading-ssr\server\middleware\index.js

React-loadable is packaged on demand with other JS besides main.js, and main.js gets an error when referencing other JS。
Can you help me see what the problem is?
My project address is https://github.com/qq281113270/react-loading-ssr
in webpack-middleware 。
Install dependencies

  npm i 

start a project

npm  run  ssr:dev:middleware