Upgrade Nuxt version and update configuration
- Updated Nuxt from version 3.21.1 to 4.3.1 in package.json for improved features and performance. - Removed outdated TypeScript error suppression in nuxt.config.ts for cleaner code. - Updated README.md to reflect the transition to Nuxt 4 and added instructions for post-upgrade steps. - Modified error handling in middleware to use consistent error property names.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
# HnH Map – Nuxt 3 frontend
|
||||
# HnH Map – Nuxt 4 frontend
|
||||
|
||||
Nuxt 3 + Tailwind + DaisyUI frontend for the HnH map. Served by the Go backend under `/map/`.
|
||||
Nuxt 4 + Tailwind + DaisyUI frontend for the HnH map. Served by the Go backend under `/map/`.
|
||||
|
||||
In dev mode the app is available at the path with baseURL **`/map/`** (e.g. `http://localhost:3000/map/`). The Go backend must be reachable (directly or via the dev proxy in `nuxt.config.ts`).
|
||||
|
||||
@@ -25,6 +25,8 @@ In dev mode the app is available at the path with baseURL **`/map/`** (e.g. `htt
|
||||
npm install
|
||||
```
|
||||
|
||||
After upgrading the repo (e.g. to Nuxt 4), run `npm install` in this directory, then `npx nuxt prepare`, and verify with `npm run build` and `npm run test`.
|
||||
|
||||
## Development
|
||||
|
||||
```bash
|
||||
|
||||
@@ -39,7 +39,6 @@ export default defineNuxtConfig({
|
||||
},
|
||||
|
||||
// Dev: proxy /map API, SSE and grids to Go backend (e.g. docker compose -f docker-compose.dev.yml)
|
||||
// @ts-expect-error nitro types lag behind Nuxt compat v4
|
||||
nitro: {
|
||||
devProxy: {
|
||||
'/map/api': { target: 'http://backend:3080/map/api', changeOrigin: true },
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
"dependencies": {
|
||||
"leaflet": "^1.9.4",
|
||||
"md5": "^2.3.0",
|
||||
"nuxt": "^3.21.1",
|
||||
"nuxt": "^4.3.1",
|
||||
"vue": "^3.5.13",
|
||||
"vue-router": "^4.5.0"
|
||||
},
|
||||
|
||||
@@ -7,6 +7,6 @@ export default defineEventHandler((event) => {
|
||||
try {
|
||||
decodeURI(path)
|
||||
} catch {
|
||||
throw createError({ statusCode: 400, statusMessage: 'Bad Request' })
|
||||
throw createError({ status: 400, statusText: 'Bad Request' })
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user