Skip to content
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

Merged
merged 1 commit into from Jan 4, 2022

Conversation

mturley
Copy link
Collaborator

@mturley mturley commented Jan 4, 2022

We missed this in #849. Because the server.js file was moved from deploy/ to pkg/api/src/ but the dist 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 in Uncaught 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

@mturley mturley requested a review from a team January 4, 2022 18:56
@sonarcloud
Copy link

sonarcloud bot commented Jan 4, 2022

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
3.3% 3.3% Duplication

@konveyor-preview-bot
Copy link

🚀 Deployed Preview: http://konveyor-forklift-ui-pr-879-preview.surge.sh

Compare with current main branch: http://konveyor-forklift-ui-preview.surge.sh

@gildub gildub merged commit fe51f06 into kubev2v:main Jan 4, 2022
@mturley mturley changed the title Fix express staticDir after moving server.js into pkg/api/src Bug 2035868: Fix express staticDir after moving server.js into pkg/api/src Jan 5, 2022
@github-actions
Copy link

github-actions bot commented Jan 5, 2022

Bug 2035868 does not have a target release set

1 similar comment
@github-actions
Copy link

github-actions bot commented Jan 5, 2022

Bug 2035868 does not have a target release set

@mturley mturley deleted the fix-express-staticdir branch January 12, 2022 16:32
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants