Cue
Cue
NNuxt
Created by Mike on 4/2/2025 in #❓・help
Auto Imports vs. components/AppHeader.vue (?)
Probably don’t. Seems a bit sus 😂
16 replies
NNuxt
Created by IsaacR943 on 3/20/2025 in #❓・help
Is this package legit?
semver is downloaded over 300 million times a week and has 5K stars. By your logic, that is highly suspicious. Yet you use it every day, unknowingly. 😅
8 replies
NNuxt
Created by Wirkhof on 3/17/2025 in #❓・help
How to disable this shaking of icon in Nuxtr
Perhaps file an issue with vscode https://github.com/microsoft/vscode
35 replies
NNuxt
Created by Wirkhof on 3/17/2025 in #❓・help
How to disable this shaking of icon in Nuxtr
It has nothing to do with Nuxt.
35 replies
NNuxt
Created by Wirkhof on 3/17/2025 in #❓・help
How to disable this shaking of icon in Nuxtr
It’s normal. It’s a language status icon. If you don’t like it, hide it. Right click and uncheck Editor Language Status.
35 replies
NNuxt
Created by deStrO on 3/13/2025 in #❓・help
Script in head not in the listed order
8 replies
NNuxt
Created by deStrO on 3/13/2025 in #❓・help
Script in head not in the listed order
use tagPriority
8 replies
NNuxt
Created by nandi95 on 3/13/2025 in #❓・help
Proxy with header
Indeed that is the way forward, particularly if you’re sending headers that are dependent during runtime (e.g. access tokens)
13 replies
NNuxt
Created by nandi95 on 3/13/2025 in #❓・help
Proxy with header
@nandi95 you can proxy via routeRules, it is covered in the documentation. However, this method will drop certain headers, specifically the Accept header, which can lead to problems if your API depends on it. For example, in Laravel, exceptions are rendered as HTML if the Accept header is not set accordingly.
13 replies
NNuxt
Created by PMDL on 10/18/2023 in #❓・help
I want to instanciate incoming data using useFetch(), should I use transform or onResponse()?
IMO I’d be explicit and create an index.ts in that directory and export the necessary classes, this way you’re not only managing your classes in one place, but not having to declare them in a plugin. You’d then do a wildcard import, where all classes are now effectively a map. While it is still a declarative way of addressing your issue, it’s much more controlled so you’re not relying on hacky logic to determine what should and shouldn’t be passed to the payload handlers.
24 replies
NNuxt
Created by PMDL on 10/18/2023 in #❓・help
I want to instanciate incoming data using useFetch(), should I use transform or onResponse()?
But this depends on how you're defining your classes. For example, are the classes named exports? Are there other exports within these files? Can you extract these easily?
24 replies
NNuxt
Created by PMDL on 10/18/2023 in #❓・help
I want to instanciate incoming data using useFetch(), should I use transform or onResponse()?
You can do, but you'd be better off doing so with a module where you can traverse your directory and extract classes into a virtual module, and define a plugin within the module to execute the above logic.
24 replies
NNuxt
Created by PMDL on 10/18/2023 in #❓・help
I want to instanciate incoming data using useFetch(), should I use transform or onResponse()?
What's the issue you're experiencing?
24 replies
NNuxt
Created by PMDL on 10/18/2023 in #❓・help
I want to instanciate incoming data using useFetch(), should I use transform or onResponse()?
That's expected since you need to explicitly define reducers/revivers.
24 replies
NNuxt
Created by PMDL on 10/18/2023 in #❓・help
I want to instanciate incoming data using useFetch(), should I use transform or onResponse()?
Perhaps define a payload class map and loop? For example:
import { instanceToPlain, plainToInstance } from 'class-transformer'

const payloadClassMap = {
NewsModel,
UserModel,
CharacteristicModel
}

export default definePayloadPlugin(() => {
for (const [name, model] of Object.entries(payloadClassMap)) {
definePayloadReducer(name, data => data instanceof model && instanceToPlain(data))
definePayloadReviver(name, data => plainToInstance(model, data))
}
})
import { instanceToPlain, plainToInstance } from 'class-transformer'

const payloadClassMap = {
NewsModel,
UserModel,
CharacteristicModel
}

export default definePayloadPlugin(() => {
for (const [name, model] of Object.entries(payloadClassMap)) {
definePayloadReducer(name, data => data instanceof model && instanceToPlain(data))
definePayloadReviver(name, data => plainToInstance(model, data))
}
})
24 replies
NNuxt
Created by phipham on 3/4/2025 in #❓・help
End-to-end typesafe for API not working in nuxt 4
@phipham In v4, ~ points to <workspace>/app and ~~ points to <workspace>...
// server/api/user.get.ts
- import { User } from '~/types'
+ import type { User } from '~~/types'
// server/api/user.get.ts
- import { User } from '~/types'
+ import type { User } from '~~/types'
6 replies
NNuxt
Created by sinewy on 2/26/2025 in #❓・help
eslint and antfu config
If you’re using the module ensure you’ve added this to your nuxt config:
eslint: {
config: {
standalone: false // <---
}
}
eslint: {
config: {
standalone: false // <---
}
}
10 replies
NNuxt
Created by negative on 2/25/2025 in #❓・help
Dark mode with neutral color seems to be broken in the UI docs
Create and report the issue here https://github.com/nuxt/ui/issues
6 replies
NNuxt
Created by svecs132 on 2/24/2025 in #❓・help
Nuxt prepare error
Try npx nuxi@latest init
9 replies