mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
fix: disable HMR proxy in test mode to prevent WebSocket interference
In test mode (`meteor test --full-app`), `Meteor.isDevelopment` is true
but no rspack dev server is running (test mode uses `runRspackBuild`,
not `startRspackClientServe`). The HMR proxy was still being activated,
registering WebSocket upgrade handlers pointing to a port where nothing
listens. This caused SockJS WebSocket corruption ("Invalid frame header")
and subsequent DDP message failures (`msg.fields` arriving as undefined).
Adding `!Meteor.isTest && !Meteor.isAppTest` to the proxy guard ensures
it is only enabled when the dev server is actually running.
This commit is contained in:
@@ -31,6 +31,7 @@ const RSPACK_ASSETS_REGEX = new RegExp(
|
||||
const shouldEnableDevHMRProxy =
|
||||
global?.Package?.["tools-core"] != null &&
|
||||
Meteor.isDevelopment &&
|
||||
!Meteor.isTest && !Meteor.isAppTest &&
|
||||
!process.env.RSPACK_NATIVE;
|
||||
if (shouldEnableDevHMRProxy) {
|
||||
const { shuffleString } = require('meteor/tools-core/lib/string');
|
||||
|
||||
Reference in New Issue
Block a user