Fix frontend config import path for production deployment#73
Merged
SmokeHound merged 1 commit intomainfrom Sep 9, 2025
Merged
Conversation
✅ Deploy Preview for workshop-order ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Contributor
There was a problem hiding this comment.
Copilot wasn't able to review any files in this pull request.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Contributor
|
Important Review skippedBot user detected. To trigger a single review, invoke the You can disable this status message by setting the Comment |
Copilot
AI
restored the
copilot/fix-d32a150f-1e5c-4ef4-aba4-7718c7e2c267
branch
September 9, 2025 18:09
Copilot
AI
changed the title
Duplicate shared config into frontend and fix broken browser import path
Fix frontend config import path for production deployment
Sep 9, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
Frontend modules import
../shared/config.jsfromfrontend/utils.js. In production deployment, the site root is the frontend/ directory, so/shared/config.jsis not served and the browser throws a 404 import error. This breaks execution of any module that depends on utils.js, including:setActiveNav)initThemeToggle)showToast)getApiBase)Solution
This PR implements the minimal, low-risk fix by duplicating the shared config file into the frontend tree and updating the import path to use a same-directory relative path.
Changes Made
Added
frontend/shared/config.js- Frontend-local copy of shared config constants with explanatory comments about the duplication and deployment constraints.Updated
frontend/utils.jsimport path - Changed from'../shared/config.js'to'./shared/config.js'to reference the new local copy.Added defensive DOM checks - Enhanced
showToast()andinitThemeToggle()functions to gracefully handle missing DOM elements instead of throwing errors.Added sync notice to original config - Updated
shared/config.jswith comment noting the duplication to prevent drift.Files Modified
Validation
Screenshot showing the frontend login page working correctly with theme toggle functionality after the fix.
Risk Assessment
Very Low Risk - Only adds one file and changes one import path. No breaking changes to existing functionality. The original
shared/config.jsis preserved for any potential backend references.Follow-up Opportunities
/shared/config.jsif backend doesn't require itThis pull request was created as a result of the following prompt from Copilot chat.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.