Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build errors main.0630ae48.js is not found #287

Open
acherla opened this issue Oct 2, 2024 · 1 comment
Open

Build errors main.0630ae48.js is not found #287

acherla opened this issue Oct 2, 2024 · 1 comment

Comments

@acherla
Copy link

acherla commented Oct 2, 2024

Describe the bug
After building the application and deploying it main.0630ae48.js is not found under /usr/share/nginx/html/static/

image

To Reproduce
Steps to reproduce the behavior:

  1. Build application using makefile
  2. deploy docker image
  3. Try to access the homepage

Expected behavior
Should be able to find the appropriate build files after the npm run build command

Version
Latest master branch

Environment
Include information like the docker command that was run, OS it is running on and other environment details.

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Root cause appears to be a misconfiguration in the Dockerfile build copy command for the client/api image where its only copying from the base llmstack/client/static directory rather than from the output build directory. This results in missing css/js/media files when building the image.

The build process is not even configured to properly merge the llmstack/client/static directory with the llmstack/client/build/static output directory.

Generally speaking I highly doubt the base build instructions for the application actually work out of the box. It appears the e2e build really only works for the promptly development team due to how their development environment is setup. Would be a good idea to document the required setup as the makefile/dockerfile's are incorrectly configured as the standard npm install && npm build commands in the makefile do not properly build the correct static file directory.

This results in the above errors as the output build files are not even copied to to the client image to serve the correct static content to a client.

Infact just looking at the code for the Dockerfile/api and Dockerfile/app files

Dockerfile/api

# Copy application code
COPY --from=builder /code/llmstack/client/build/index.html /code/llmstack/client/build/index.html
COPY --from=builder /code/llmstack/client/build/static /code/llmstack/client/build/static
COPY --from=builder /code/llmstack/static /code/llmstack/static

Dockerfile/app

FROM <image-registry>:${TAG:-main} AS builder

# Copy static files from Django to nginx
COPY --from=builder /code/llmstack/static /usr/share/nginx/html/static

In the above code block the app image literally doesn't even copy any files from the output build directory from the initial api image

@acherla acherla changed the title main.0630ae48.js is not found Build errors main.0630ae48.js is not found Oct 2, 2024
@acherla
Copy link
Author

acherla commented Oct 2, 2024

Confirmed that adding the following to Dockerfile/app resolved the issue, PR should be pushed up to resolve the problem

# Copy static files from Django to nginx
COPY --from=builder /code/llmstack/client/build/index.html /usr/share/nginx/html/index.html
COPY --from=builder /code/llmstack/static /usr/share/nginx/html/static

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant