fix(remix-dev): ensure devServerPort config value is the same across reloads #3202
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes: #2958
If the devServerPort changes values across config reloads then LiveReload will attempt to connect to an incorrect port. Files being created, deleted, or renamed under the app folder trigger config reloads.
Testing Strategy:
A test is included in the commit that ensures that the same devServerPort is always returned.
Additionally, I tested a new project with this code using the following steps:
npm run dev
app/routes/index.tsx
and observing the change.app/components/SomeComponent.tsx
and observe page refresh. Validate no websocket errors in browser console.app/routes/index.tsx
and observing the change.