Closed remihuigen closed 2 months ago
Nevermind, it's a cors issue in my nuxt app š
Nevermind, it's a cors issue in my nuxt app š
@remihuigen I'm experiencing the same thing, nothing specific configured cors whise. How did you resolve this?
@stigvanbrabant I've added server middleware to set cors headers for the /_hub
routes
export default defineEventHandler((event) => {
if (!event._path?.startsWith('/api/_hub')) {
setResponseHeaders(event, {
"Access-Control-Allow-Methods": "GET,POST,PUT,DELETE,PATCH",
"Access-Control-Allow-Origin": "*",
'Access-Control-Allow-Credentials': 'true',
"Access-Control-Allow-Headers": '*',
"Access-Control-Expose-Headers": '*'
})
if (event.method === 'OPTIONS') {
event.node.res.statusCode = 204
event.node.res.statusMessage = "No Content."
return 'OK'
}
}
})
Describe the bug Devtools > Hub Database returns error. This happens for both local storage and remote storage (preview / production)
Steps to reproduce