Conversation
react-dates is no longer maintained and no longer supports later react versions.
| target: API_HOST, | ||
| changeOrigin: true, | ||
| secure: false, | ||
| rewrite: (path) => path.replace(/^\/api/, '/api'), |
Check warning
Code scanning / CodeQL
Replacement of a substring with itself Medium
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 7 months ago
To fix the issue, we need to replace the redundant path.replace(/^\/api/, '/api') operation with a meaningful transformation or remove it entirely if no transformation is needed. If the intention is to ensure the /api prefix remains unchanged, the function can simply return the path as is. Alternatively, if the intention is to rewrite the path in a specific way, the replacement logic should be corrected to achieve the desired transformation.
Suggested changeset
1
client/vite.config.js
| @@ -45,3 +45,3 @@ | ||
| secure: false, | ||
| rewrite: (path) => path.replace(/^\/api/, '/api'), | ||
| rewrite: (path) => path, | ||
| }, |
Copilot is powered by AI and may make mistakes. Always verify output.
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.
Migrated from Create React App (soft eject) to Vite
This allows a clear separation of build and runtime processes and values
Upgraded Node.js from 18 to 24
Reinstalled all packages to ensure compatibility
Upgraded necessary packages
Removed unused packages
Added ESLint + Prettier with custom rules
Applied those rules to the entire client codebase
Upgrade Bootstrap from 4 to 5:
upgraded deprecated react-dates to react-date-range
This involved fixing everything frontend as mentioned in their lengthy doc on migrating
Bugfixes:
Fixed multiple bugs introduced by upgraded libraries
Process improvements:
nginx start script and Dockerfiles modified to ensure compatbility with the new Vite build tool