Skip to content

Conversation

@ionwyn
Copy link
Collaborator

@ionwyn ionwyn commented Jun 26, 2025

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

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

This replaces '/api' with itself.

Copilot Autofix

AI 6 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

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/client/vite.config.js b/client/vite.config.js
--- a/client/vite.config.js
+++ b/client/vite.config.js
@@ -45,3 +45,3 @@
           secure: false,
-          rewrite: (path) => path.replace(/^\/api/, '/api'),
+          rewrite: (path) => path,
         },
EOF
@@ -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.
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.

2 participants