Yaiko
Yaiko
NNuxt
Created by Yaiko on 9/21/2024 in #❓・help
Nuxt Layers custom nuxt.config?
When creating a layer I see is possible to add custom app.config via the AppConfigInput interface but how is possible creating custom nuxt.config ? I tried declaring other @nuxt/schema interfaces but didn't worked. I want to add custom nuxt.config so is possible to override the layer configs (like in modules with configKey). Does anybody knows how to do this?, Thanks.
1 replies
NNuxt
Created by Yaiko on 9/1/2024 in #❓・help
(tsx) Auto imports typings
1 replies
NNuxt
Created by Yaiko on 5/8/2024 in #❓・help
Dynamic RuntimeConfig?
I have a site that has dynamic subdomains with a nginx reverse proxy. So in each request Nuxt renders the site with the local URL (http://localhost:3001), so I have to set the domain in the config app.cdnURL, the problem here is that the subdomain needs to be dynamic by the request (Like from the origin header), so I have no idea how to set this variable dynamically. Already tried with modules and plugins, but none worked. Does anyone knows how to fix this?, Thanks. https://github.com/nuxt/nuxt/discussions/27118
3 replies
NNuxt
Created by Yaiko on 4/17/2024 in #❓・help
Nitro plugin while loop stucks server
I have a simple plugin that reads a file and runs some code periodically.
const task = () => {
while (1){
// Reads file and runs code if data on it
}
}

export default defineNitroPlugin(() => {
task();
});
const task = () => {
while (1){
// Reads file and runs code if data on it
}
}

export default defineNitroPlugin(() => {
task();
});
The while makes the server go stuck, is there an alternative to run a code like that in the server background without breaking the rest of the server? Thanks. https://github.com/nuxt/nuxt/issues/26809
20 replies
NNuxt
Created by Yaiko on 2/18/2023 in #❓・help
[3.2.2] `createError` on Api
When using return/throw createError() in Api routes is returning the error page instead of being parsed to JSON, it used to work well before 3.2.2
5 replies
NNuxt
Created by Yaiko on 1/6/2023 in #❓・help
Including folders on build?
It is possible to include other folders in the build in server/? for example I have scripts/1.ts that depends on a package of the project, that it is run manually via a command... How could be this folder be included in the .output folder or .output/server folder to be used?
3 replies
NNuxt
Created by Yaiko on 12/4/2022 in #❓・help
useFetch in Nuxt Plugin
Environment - Operating System: Darwin - Node Version: v16.14.0 - Nuxt Version: 3.0.0-rc.14 - Nitro Version: 1.0.0 - Package Manager: [email protected] - Builder: vite - User Config: css, build, modules - Runtime Modules: @pinia/[email protected], () - Build Modules: - Reproduction Reproduction link: https://stackblitz.com/edit/github-9edfuk Describe the bug I'm trying to understand how the Server-side requests can work, I'm trying to use a useFetch inside a defineNuxtPlugin to get the user data before loading the page on client side but I'm getting: [Vue warn]: onServerPrefetch is called when there is no active component instance to be associated with. Lifecycle injection APIs can only be used during execution of setup(). If you are using async setup(), make sure to register lifecycle hooks before the first await statement. In the docs says useFetch can be used inside plugins, but I'm getting this warning. https://nuxt.com/docs/getting-started/data-fetching#usefetch
1 replies