Skip to content

[bug]: Webpack dev server not matching production behaviour #2903

Open
@fooman

Description

Describe the bug
The dev experience should work in a similar fashion to the production environment.

To reproduce
Steps to reproduce the behavior:

  1. Start with a scaffolded project
  2. yarn build
  3. DEBUG=hastily:*,upward* yarn start
  4. curl URL of upward + image (for example curl https://fooman-pwa-frontend-gh6ov.local.pwadev:9730/venia-static/veniaClosed.png)
  5. note upward output
GET /venia-static/veniaClosed.png 200 285.921 ms - 28966
  1. stop serve (ctrl +c)
  2. DEBUG=hastily:*,upward* yarn watch
  3. Repeat 4 with dev server url

Expected behavior
the watch console should show a similar output on 4 and 8. Seeing no output would indicate the response was not provided by upward.

Overall use case that I was trying to work out was to use the image optimisation on static files that are provided in the frontend rather than hosted on the back-end.

Possible solutions
My best guess is that webpack's dev server gets prioritised on existing files before upward. As a comparison running against a proxied image file, ie using curl with a product image starting with media/catalog/product/ this will again show that the response has gone through upward.

Please complete the following device information:

  • Device [e.g. iPhone6, PC, Mac, Pixel3]:
  • OS [e.g. iOS8.1, Windows 10]:
  • Browser [e.g. Chrome, Safari]:
  • Browser Version [e.g. 22]:
  • Magento Version:
  • PWA Studio Version:
  • NPM version npm -v:
  • Node Version node -v:

Please let us know what packages this bug is in regards to:

  • venia-concept
  • venia-ui
  • pwa-buildpack
  • peregrine
  • pwa-devdocs
  • upward-js
  • upward-spec
  • create-pwa

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions