Open censujiang opened 3 weeks ago
key code:
import redisDriver from 'unstorage/drivers/redis'
import azureAppConfigurationDriver from 'unstorage/drivers/azure-app-configuration'
export default defineNitroPlugin((nuxtApp) => {
const storage = useStorage()
if (useRuntimeConfig().systemRuntimeType == 'azure') {
storage.unmount('cache')
const azure = azureAppConfigurationDriver({
prefix: "default",
label: "cache",
})
storage.mount('cache', azure)
} else {
storage.unmount('cache')
const redis = redisDriver({
url: "redis://localhost:6379",
})
storage.mount('cache', redis)
}
})
Environment
Reproduction
https://stackblitz.com/edit/github-sbrgxd?file=server%2Fplugins%2Fstorage.ts
Describe the bug
As the title indicates, as long as the driver name is cache, an error will occur during the build or dev.
https://github.com/unjs/nitro/issues/1161#issuecomment-2295248527
Additional context
The problem occurs in the build phase of my Nuxt App, but not in the dev phase of the Nitro copy I provided
Logs