diff --git a/rspack.config.ts b/rspack.config.ts index 99e47d15f..29bfafcfc 100644 --- a/rspack.config.ts +++ b/rspack.config.ts @@ -434,7 +434,11 @@ module.exports = { }, port: 19006, hot: true, - historyApiFallback: true, + historyApiFallback: { + // Handles like `xan.lol` contain dots, which the default history + // fallback treats as asset requests instead of app routes. + disableDotRule: true, + }, compress: true, }, diff --git a/webpack.config.js b/webpack.config.js index 37c110c7b..1c688ae60 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -39,6 +39,13 @@ module.exports = async function (env, argv) { ] if (env.mode === 'development') { config.plugins.push(new ReactRefreshWebpackPlugin()) + config.devServer = config.devServer || {} + config.devServer.historyApiFallback = { + ...(config.devServer.historyApiFallback || {}), + // Handles like `xan.lol` contain dots, which the default history + // fallback treats as asset requests instead of app routes. + disableDotRule: true, + } // Reap zombie HMR WebSocket connections that linger after refresh. // Without this, dead sockets exhaust the browser's per-origin connection // pool and the dev server stops responding.