fix(security): resolve critical audit vulnerabilities and replace nuxt-mapbox - #107
Merged
Merged
Conversation
Remove nuxt-mapbox wrapper to resolve critical vulnerability from transitive @nuxt/devtools, and initialize mapbox-gl directly in MapRD. Resolves #83
There was a problem hiding this comment.
🟡 Changes recommended
MapRD.vue imports mapbox-gl at module-evaluation time, which is likely to break SSR/prerender for / unless the import is made client-only via lazy/dynamic import.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR addresses pnpm audit critical vulnerabilities by removing the unmaintained nuxt-mapbox wrapper and switching the site’s map section to direct mapbox-gl usage, while also applying a small set of dependency/workspace maintenance updates.
Changes:
- Replace
nuxt-mapboxusage with directmapbox-glinitialization in theMapRDsection component. - Remove
nuxt-mapboxmodule registration and its config fromnuxt.config.ts, and update README accordingly. - Update a few dependencies and adjust
pnpm-workspace.yamlsettings (including removing an old Vite override).
File summaries
| File | Description |
|---|---|
| README.md | Updates tech stack docs to reflect mapbox-gl instead of nuxt-mapbox. |
| pnpm-workspace.yaml | Adds minimumReleaseAgeExclude entries and removes the obsolete Vite override. |
| package.json | Removes nuxt-mapbox, bumps a few deps, and relies on mapbox-gl directly. |
| nuxt.config.ts | Drops nuxt-mapbox module registration and its config block. |
| app/components/sections/MapRD.vue | Reimplements the map section using direct mapbox-gl API calls. |
Review details
Suppressed comments (1)
app/components/sections/MapRD.vue:16
- After switching to a lazy client-side import, the map initialization should await the dynamic import and ensure it only runs on the client. This avoids SSR/prerender crashes and keeps the component safe in Node environments.
onMounted(() => {
if (!accessToken || !mapContainer.value) return;
mapboxgl.accessToken = accessToken;
map = new mapboxgl.Map({
container: mapContainer.value,
- Files reviewed: 5/6 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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.
Summary
Resolves the critical vulnerability reported by
pnpm auditby removing the unmaintainednuxt-mapboxwrapper (which dragged in vulnerable transitive@nuxt/devtoolsversions) and replacing it with nativemapbox-gl. Also updates minor dependencies and removes an obsolete Vite override.Changes
nuxt-mapboxwrapper inapp/components/sections/MapRD.vuewith directmapbox-glinstantiation (onMounted/onUnmounted)nuxt.config.tsandREADME.mdnuxt-mapboxpackage and pruned 147 obsolete transitive dependencies, completely resolving the critical@nuxt/devtoolsRPC vulnerability (GHSA-279x-mwfv-vcqv)@langchain/core(1.2.10),langchain(1.5.11),@types/node(26.5.1), andhappy-dom(20.14.3)pnpm-workspace.yamlvite: ^8.2.2override inpnpm-workspace.yaml(Nuxt 4 and Vitest 5 now resolve Vite 8 natively)Verification
pnpm audit --prod --audit-level high: 0 critical and 0 high vulnerabilities found (Exit 0)pnpm test: 44/44 tests passing across 10 test filespnpm lint: 0 errors (ESLint and Prettier passed cleanly)Closes #83