Josef Trojkař
Josef Trojkař
NNuxt
Created by Josef Trojkař on 2/21/2025 in #❓・help
addAbortListener import broken on NuxtHub deployment
[log] [nuxi] Nuxt 3.15.4 with Nitro 2.10.4
19:18:55.348 [error] The requested module 'node:events' does not provide an export named 'addAbortListener'
19:18:55.349 import {addAbortListener} from 'node:events';
19:18:55.349 ^^^^^^^^^^^^^^^^
19:18:55.349 SyntaxError: The requested module 'node:events' does not provide an export named 'addAbortListener'
19:18:55.349 at ModuleJob._instantiate (node:internal/modules/esm/module_job:124:21)
19:18:55.350 at async ModuleJob.run (node:internal/modules/esm/module_job:190:5)
[log] [nuxi] Nuxt 3.15.4 with Nitro 2.10.4
19:18:55.348 [error] The requested module 'node:events' does not provide an export named 'addAbortListener'
19:18:55.349 import {addAbortListener} from 'node:events';
19:18:55.349 ^^^^^^^^^^^^^^^^
19:18:55.349 SyntaxError: The requested module 'node:events' does not provide an export named 'addAbortListener'
19:18:55.349 at ModuleJob._instantiate (node:internal/modules/esm/module_job:124:21)
19:18:55.350 at async ModuleJob.run (node:internal/modules/esm/module_job:190:5)
Constantly fighting with the above error in my nuxthub deployment. Worked fine before but after some package update (unfortunately I am unable to track down specifically which one), this error started occuring on every deployment. Tried changing the node.js version many times to many different versions with no avail. Can't find any answers online. Any ideas?
10 replies
NNuxt
Created by Josef Trojkař on 11/21/2024 in #❓・help
NuxtHub blob prefix not creating a new path
When I set a prefix for an image upload like this:
await hubBlob().handleUpload(event, {
multiple: false,
ensure: {
types: ['image/jpeg', 'image/png', 'image/webp'],
},
put: {
prefix: 'transformations'
}
})
await hubBlob().handleUpload(event, {
multiple: false,
ensure: {
types: ['image/jpeg', 'image/png', 'image/webp'],
},
put: {
prefix: 'transformations'
}
})
The image is accessible at: /images/transformations%2Fimage.png instead of what I expect: /images/transformations/image.png. BUT in the nuxt devtools path it IS accessible at: /api/_hub/blob/transformations/image.png . No errors appear anywhere. In nuxt devtools, I can normally view my blob storage and the image is correctly placed inside the folder 'transformations'. Is this intended behavior? If not, how do I fix it? I care mainly because of SEO. I don't want my image names to be plagued with a prefix not necessarily related to the image.
4 replies