This repository has been archived by the owner on Jan 12, 2023. It is now read-only.
Bug 2035868: Fix express staticDir after moving server.js into pkg/api/src #879
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.
We missed this in #849. Because the
server.js
file was moved fromdeploy/
topkg/api/src/
but thedist
still gets built at the repo root, the../dist
path was no longer matching anything and so Express was failing to find any files we tried to serve from that path (app.bundle.js, the CSS and favicons, etc). Instead it was hitting the fallback*
controller which renders the HTML. The result is that an HTML response was attempting to be parsed as JS, resulting inUncaught SyntaxError: Unexpected token '<'
. We didn't catch this because we didn't test a full prod build until now and this path is not used in dev mode.This fixes the relative
staticDir
path to be../../../dist
so it can properly host the files in the root dist directory from the server's new path.https://bugzilla.redhat.com/show_bug.cgi?id=2035868