Skip to content

build: fix frontend docker build and runtime errors#809

Merged
CodeWithCJ merged 1 commit intomainfrom
dev
Mar 1, 2026
Merged

build: fix frontend docker build and runtime errors#809
CodeWithCJ merged 1 commit intomainfrom
dev

Conversation

@CodeWithCJ
Copy link
Owner

  • Update Dockerfiles to use pnpm@10.30.3 and include pnpm-workspace.yaml
  • Fix Auth UI bug where magic link modal appeared by default
  • Resolve production 'createContext' error via React deduplication in Vite
  • Add packageManager to root package.json for version enforcement
  • Cleanup redundant package-lock.json and bun.lockb files

Tip

Help us review and merge your PR faster!
Please ensure you have completed the Checklist below.
For Frontend changes, please run pnpm run validate to check for any errors.
PRs that include tests and clear screenshots are highly preferred!

Description

Provide a brief summary of your changes.

Related Issue

PR type [ ] Issue [ ] New Feature [ ] Documentation
Linked Issue: #

Checklist

Please check all that apply:

  • [MANDATORY for new feature] Alignment: I have raised a GitHub issue and it was reviewed/approved by maintainers
  • Tests: I have included automated tests for my changes.
  • [MANDATORY for UI changes] Screenshots: I have attached "Before" vs "After" screenshots below.
  • [MANDATORY for Frontend changes] Quality: I have run pnpm run validate (especially for Frontend).
  • Translations: I have only updated the English (en) translation file (if applicable).
  • Architecture: My code follows the existing architecture standards.
  • Database Security: I have updated rls_policies.sql for any new user-specific tables.
  • [MANDATORY - ALL] Integrity & License: I certify this is my own work, free of malicious code(phishing, malware, etc.) and I agree to the License terms.

Screenshots (if applicable)

Before

[Insert screenshot/GIF here]

After

[Insert screenshot/GIF here]

- Update Dockerfiles to use pnpm@10.30.3 and include pnpm-workspace.yaml
- Fix Auth UI bug where magic link modal appeared by default
- Resolve production 'createContext' error via React deduplication in Vite
- Add packageManager to root package.json for version enforcement
- Cleanup redundant package-lock.json and bun.lockb files
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly improves the stability and consistency of the frontend development and deployment process. It standardizes the package manager version used in Docker builds, resolves a critical production build error related to React context, and fixes an annoying UI bug in the authentication flow. These changes contribute to a more robust and predictable development experience.

Highlights

  • Frontend Docker Builds: Updated both production and development Dockerfiles for the frontend to explicitly use pnpm@10.30.3 instead of pnpm@latest, ensuring consistent dependency management across environments. The Dockerfiles also now copy the pnpm-workspace.yaml file.
  • Authentication UI Fix: Resolved a bug in the Auth UI where the magic link request modal would appear by default. The MagicLinkRequestDialog is now conditionally rendered based on the isMagicLinkRequestDialogOpen state, preventing its unintended initial display.
  • Production Build Stability: Addressed a production createContext error by configuring Vite to deduplicate react and react-dom dependencies. This prevents issues arising from multiple instances of React in the build.
  • Dependency Manager Enforcement: Enforced the use of pnpm@10.30.3 by adding the packageManager field to the root package.json file, standardizing the package manager version for all contributors.
Changelog
  • SparkyFitnessFrontend/.agent/workflows/fix-custom-nutrients.md
    • Removed a workflow file that was likely no longer needed or relevant.
  • SparkyFitnessFrontend/src/pages/Auth/Auth.tsx
    • Modified the Auth component to wrap the MagicLinkRequestDialog in a conditional render block, ensuring it only appears when explicitly triggered.
  • SparkyFitnessFrontend/vite.config.ts
    • Added dedupe: ['react', 'react-dom'] to the Vite configuration's optimizeDeps options to prevent duplicate React instances.
  • docker/Dockerfile.frontend
    • Updated the corepack prepare command to specify pnpm@10.30.3 instead of pnpm@latest.
    • Ensured pnpm-workspace.yaml is copied into the Docker image.
  • docker/Dockerfile.frontend.dev
    • Updated the corepack prepare command to specify pnpm@10.30.3 instead of pnpm@latest.
    • Ensured pnpm-workspace.yaml is copied into the Docker image.
  • package.json
    • Added the packageManager field with the value pnpm@10.30.3 to the root package.json.
Activity
  • No specific activity (comments, reviews, or progress updates) has been recorded for this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@CodeWithCJ CodeWithCJ merged commit 9f77bd2 into main Mar 1, 2026
6 checks passed
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces several fixes and improvements to the frontend build process and runtime behavior. The Dockerfiles are updated to use a pinned version of pnpm (10.30.3), and the root package.json now enforces this version, which enhances build reproducibility. A runtime bug with the magic link modal is fixed by using conditional rendering. Additionally, a potential production error is addressed by deduplicating react and react-dom in the Vite config.

While reviewing, I noticed that in docker/Dockerfile.frontend, the base image nginx:alpine3.22 is used. This tag does not appear to be valid on Docker Hub and will likely cause the build to fail. You may want to replace it with a valid tag, such as nginx:alpine or a specific version like nginx:1.27.0-alpine.

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

Successfully merging this pull request may close these issues.

1 participant