mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-22 21:55:11 +00:00
fix(nuxt): ignore cache rules for middleware and errors (#8291)
This commit is contained in:
parent
e0d6812b66
commit
2b2a5f3f89
@ -58,7 +58,7 @@
|
|||||||
"knitwork": "^0.1.2",
|
"knitwork": "^0.1.2",
|
||||||
"magic-string": "^0.26.7",
|
"magic-string": "^0.26.7",
|
||||||
"mlly": "^0.5.16",
|
"mlly": "^0.5.16",
|
||||||
"nitropack": "npm:nitropack-edge@0.6.0-27768225.ba21751",
|
"nitropack": "npm:nitropack-edge@0.6.0-27768582.4603279",
|
||||||
"nuxi": "3.0.0-rc.11",
|
"nuxi": "3.0.0-rc.11",
|
||||||
"ohash": "^0.1.5",
|
"ohash": "^0.1.5",
|
||||||
"ohmyfetch": "^0.4.20",
|
"ohmyfetch": "^0.4.20",
|
||||||
|
@ -37,6 +37,9 @@ export async function initNitro (nuxt: Nuxt & { _nitro?: Nitro }) {
|
|||||||
devHandlers: [],
|
devHandlers: [],
|
||||||
baseURL: nuxt.options.app.baseURL,
|
baseURL: nuxt.options.app.baseURL,
|
||||||
virtual: {},
|
virtual: {},
|
||||||
|
routeRules: {
|
||||||
|
'/__nuxt_error': { cache: false }
|
||||||
|
},
|
||||||
runtimeConfig: {
|
runtimeConfig: {
|
||||||
...nuxt.options.runtimeConfig,
|
...nuxt.options.runtimeConfig,
|
||||||
nitro: {
|
nitro: {
|
||||||
|
@ -20,9 +20,10 @@ export default <NitroErrorHandler> async function errorhandler (error: H3Error,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Set response code and message
|
// Set response code and message
|
||||||
event.res.statusCode = errorObject.statusCode as any as number
|
event.res.statusCode = (errorObject.statusCode !== 200 && errorObject.statusCode) as any as number || 500
|
||||||
|
if (errorObject.statusMessage) {
|
||||||
event.res.statusMessage = errorObject.statusMessage
|
event.res.statusMessage = errorObject.statusMessage
|
||||||
|
}
|
||||||
// Console output
|
// Console output
|
||||||
if (error.unhandled || error.fatal) {
|
if (error.unhandled || error.fatal) {
|
||||||
const tags = [
|
const tags = [
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
"@types/semver": "^7",
|
"@types/semver": "^7",
|
||||||
"@vitejs/plugin-vue": "^3.1.2",
|
"@vitejs/plugin-vue": "^3.1.2",
|
||||||
"@vueuse/head": "~1.0.0-rc.9",
|
"@vueuse/head": "~1.0.0-rc.9",
|
||||||
"nitropack": "npm:nitropack-edge@0.6.0-27768225.ba21751",
|
"nitropack": "npm:nitropack-edge@0.6.0-27768582.4603279",
|
||||||
"unbuild": "latest",
|
"unbuild": "latest",
|
||||||
"vite": "~3.1.8"
|
"vite": "~3.1.8"
|
||||||
},
|
},
|
||||||
|
@ -429,7 +429,7 @@ importers:
|
|||||||
knitwork: ^0.1.2
|
knitwork: ^0.1.2
|
||||||
magic-string: ^0.26.7
|
magic-string: ^0.26.7
|
||||||
mlly: ^0.5.16
|
mlly: ^0.5.16
|
||||||
nitropack: npm:nitropack-edge@0.6.0-27768225.ba21751
|
nitropack: npm:nitropack-edge@0.6.0-27768582.4603279
|
||||||
nuxi: workspace:*
|
nuxi: workspace:*
|
||||||
ohash: ^0.1.5
|
ohash: ^0.1.5
|
||||||
ohmyfetch: ^0.4.20
|
ohmyfetch: ^0.4.20
|
||||||
@ -473,7 +473,7 @@ importers:
|
|||||||
knitwork: 0.1.2
|
knitwork: 0.1.2
|
||||||
magic-string: 0.26.7
|
magic-string: 0.26.7
|
||||||
mlly: 0.5.16
|
mlly: 0.5.16
|
||||||
nitropack: /nitropack-edge/0.6.0-27768225.ba21751
|
nitropack: /nitropack-edge/0.6.0-27768582.4603279
|
||||||
nuxi: link:../nuxi
|
nuxi: link:../nuxi
|
||||||
ohash: 0.1.5
|
ohash: 0.1.5
|
||||||
ohmyfetch: 0.4.20
|
ohmyfetch: 0.4.20
|
||||||
@ -508,7 +508,7 @@ importers:
|
|||||||
create-require: ^1.1.1
|
create-require: ^1.1.1
|
||||||
defu: ^6.1.0
|
defu: ^6.1.0
|
||||||
jiti: ^1.16.0
|
jiti: ^1.16.0
|
||||||
nitropack: npm:nitropack-edge@0.6.0-27768225.ba21751
|
nitropack: npm:nitropack-edge@0.6.0-27768582.4603279
|
||||||
pathe: ^0.3.9
|
pathe: ^0.3.9
|
||||||
pkg-types: ^0.3.5
|
pkg-types: ^0.3.5
|
||||||
postcss-import-resolver: ^2.0.0
|
postcss-import-resolver: ^2.0.0
|
||||||
@ -537,7 +537,7 @@ importers:
|
|||||||
'@types/semver': 7.3.12
|
'@types/semver': 7.3.12
|
||||||
'@vitejs/plugin-vue': 3.1.2_vite@3.1.8
|
'@vitejs/plugin-vue': 3.1.2_vite@3.1.8
|
||||||
'@vueuse/head': 1.0.0-rc.9
|
'@vueuse/head': 1.0.0-rc.9
|
||||||
nitropack: /nitropack-edge/0.6.0-27768225.ba21751
|
nitropack: /nitropack-edge/0.6.0-27768582.4603279
|
||||||
unbuild: 0.9.4
|
unbuild: 0.9.4
|
||||||
vite: 3.1.8
|
vite: 3.1.8
|
||||||
|
|
||||||
@ -6453,8 +6453,8 @@ packages:
|
|||||||
/neo-async/2.6.2:
|
/neo-async/2.6.2:
|
||||||
resolution: {integrity: sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==}
|
resolution: {integrity: sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==}
|
||||||
|
|
||||||
/nitropack-edge/0.6.0-27768225.ba21751:
|
/nitropack-edge/0.6.0-27768582.4603279:
|
||||||
resolution: {integrity: sha512-XDXE1D4oDuiuqGy578WvWlDT9eQEVVFqaQVEygTcmJahdkW2yWHhBM94xWrvQcw7MUWNzIzF716TK4s5QK13Fw==}
|
resolution: {integrity: sha512-pyKJG/xE8F3g/Z7vkyvSS2dEIDAII8mp4GMcUfxxR6+PubNy2nI87udKGKqQF2DFlEIlw5VLr+DqET7+FqwMOQ==}
|
||||||
engines: {node: ^14.16.0 || ^16.11.0 || ^17.0.0 || ^18.0.0}
|
engines: {node: ^14.16.0 || ^16.11.0 || ^17.0.0 || ^18.0.0}
|
||||||
hasBin: true
|
hasBin: true
|
||||||
dependencies:
|
dependencies:
|
||||||
|
Loading…
Reference in New Issue
Block a user