Skip to content

parcel-cache from dev environment leaks into docker build #3751

Description

@jennifer-richards

What happened?

On a freshly built set of docker images, many javascript tests failed with errors like

======================================================================
FAIL: test_replace_proceedings_material_shows_correct_default (ietf.meeting.tests_js.ProceedingsMaterialTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/workspace/ietf/utils/jstest.py", line 91, in tearDown
    self.assertEqual("", msg)
AssertionError: '' != 'SEVERE: http://localhost:60355/static/iet[1415 chars]t"\n'
+ SEVERE: http://localhost:60355/static/ietf/js/ietf.js 289 WebSocket connection to 'ws://localhost:1234/' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED
+ SEVERE: http://localhost:60355/static/ietf/js/ietf.js 340:16 undefined
+ WARNING: http://localhost:60355/static/ietf/js/ietf.js 343:16 "[parcel] 🚨 Connection to the HMR server was lost"
+ SEVERE: http://localhost:60355/static/ietf/js/ietf.js 289 WebSocket connection to 'ws://localhost:1234/' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED
+ SEVERE: http://localhost:60355/static/ietf/js/ietf.js 340:16 undefined
+ WARNING: http://localhost:60355/static/ietf/js/ietf.js 343:16 "[parcel] 🚨 Connection to the HMR server was lost"
+ SEVERE: http://localhost:60355/static/ietf/js/ietf.js 289 WebSocket connection to 'ws://localhost:1234/' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED
+ SEVERE: http://localhost:60355/static/ietf/js/ietf.js 340:16 undefined
+ WARNING: http://localhost:60355/static/ietf/js/ietf.js 343:16 "[parcel] 🚨 Connection to the HMR server was lost"
+ SEVERE: http://localhost:60355/static/ietf/js/ietf.js 289 WebSocket connection to 'ws://localhost:1234/' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED
+ SEVERE: http://localhost:60355/static/ietf/js/ietf.js 340:16 undefined
+ WARNING: http://localhost:60355/static/ietf/js/ietf.js 343:16 "[parcel] 🚨 Connection to the HMR server was lost"

The WebSocket errors are a side effect of having run npx parcel watch while doing development before building the docker images. In that mode, parcel monitors its inputs for changes, then rebuilds and uses a WebSocket connection to notify the browser to reload its assets.

When called as npx parcel build afterwards, parcel is not smart enough to ignore the cached code that is involved in that connection. The prepackaged assets on the docker image expect to communicate with parcel over a WebSocket.

Working around this is as simple as running npx parcel build in the docker container once built, because it has its own empty .parcel-cache mounted from a volume. Apparently the host .parcel-cache is still in use while docker is building the app image. The build process should either clear the cache or otherwise ignore the existing cache contents.

What browser(s) are you seeing the problem on?

Not Applicable

Code of Conduct

  • I agree to follow the IETF's Code of Conduct

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions