kogratte
kogratte
NNuxt
Created by kogratte on 11/7/2024 in #❓・help
TOO_MANY_REDIRECT - How to track the culprit?
Hello guys. Mostly from nowhere, or at least nowhere I can look at, I end up having 407 redirection when loading my app. I'm not able to identify the culprit, and was wondering which will be the best path to track and understand the root cause. Any tips, inspect flag or something I can use to understand what nitro is doing under the hood? #nitro #redirect #debug
13 replies
NNuxt
Created by kogratte on 10/4/2024 in #❓・help
Deployment through API Manager
Hello guys! We're working on a nuxt3 app, with classic static / api elements. We're hosting our static content to a CDN, and our backend is running behind a NodeJS server on our own. The current NodeJS server is our main entry point, as our website directly point to it. From here, the index file is loaded and all subsequent dependencies are fetched from CDN. Api calls are handled by the same server. We know, almost for sure, we'll need later to expose those apis to our customers, which means we'll need to secure them behind an api manager. Is that something which has been already done somewhere? I guess we'll need to deploy two servers. A first one being a very dumb server to serve only for landing purpose, and which will only serve the root index file (+ runtime config), and another one, being private this time, exposed behind our api manager. I wonder if they're existing flags which may be used in order to tell nitro "eh, in this situation, do not serve api nor static assets". Is there an equivalent to NITRO_SERVE_STATIC = false for api routes?
1 replies
NNuxt
Created by kogratte on 9/24/2024 in #❓・help
Unresponsive navigateTo
Hello guys! Has anyone ever seen, an unresponsive navigateTo call? The view is stucked on the loaded screen, and the url isn't updated. Something else really weird, a <a href> is working well, but a <v-list-item :to> isn't... I do not have any idea re. how to debug the root cause...
2 replies
NNuxt
Created by kogratte on 7/29/2024 in #❓・help
Fetch referential at build time
Hey there! This question seems to have been asked twice, but none of them was helpful... I'm working on an electron app which is supposed to be shipped with a copy of a referential, given at build time. What I would like to know is how can I leverage on the hook system to fetch this data and inject it into the app, like a "fake file". This behaviour looks close to what is done with .nuxt...
2 replies
NNuxt
Created by kogratte on 7/15/2024 in #❓・help
Issue with nitro?
npx nuxi dev
Nuxt 3.12.3 with Nitro 2.9.7 9:02:51 AM
9:02:51 AM
Local: http://localhost:3000/
Network: use --host to expose

DevTools: press Shift + Option + D in the browser (v1.3.9) 9:02:56 AM ℹ Re-optimizing dependencies because lockfile has changed 9:02:57 AM ✔ Nuxt Nitro server built in 1658 ms nitro
9:03:02 AM ℹ Vite client warmed up in 4275ms 9:03:02 AM
[9:03:02 AM] ERROR [worker reload] [worker init] Package import specifier "#internal/nitro/virtual/app-config" is not defined in package /Users/nico/sources/node_modules/nitropack/package.json imported from /Users/nico/sources/node_modules/nitropack/dist/runtime/config.mjs
npx nuxi dev
Nuxt 3.12.3 with Nitro 2.9.7 9:02:51 AM
9:02:51 AM
Local: http://localhost:3000/
Network: use --host to expose

DevTools: press Shift + Option + D in the browser (v1.3.9) 9:02:56 AM ℹ Re-optimizing dependencies because lockfile has changed 9:02:57 AM ✔ Nuxt Nitro server built in 1658 ms nitro
9:03:02 AM ℹ Vite client warmed up in 4275ms 9:03:02 AM
[9:03:02 AM] ERROR [worker reload] [worker init] Package import specifier "#internal/nitro/virtual/app-config" is not defined in package /Users/nico/sources/node_modules/nitropack/package.json imported from /Users/nico/sources/node_modules/nitropack/dist/runtime/config.mjs
Any idea what may cause this kind of issues?
2 replies
NNuxt
Created by kogratte on 7/11/2024 in #❓・help
Hashmode, dynamic asset url
Hey there! I'm using a component from a layer which use a public image, which src is based on some conditions. On my component, it looks like somethings like this:
<template>
<img :src="something" />
</template>
<script setup lang="ts">
const something = useSomeMagic();
</script>
<template>
<img :src="something" />
</template>
<script setup lang="ts">
const something = useSomeMagic();
</script>
utils/useSomeMagic.ts
export default () => {
const theme = useTheme();
return `/img.${theme.current.value.isDark ? 'dark': 'ligh'}.svg`
}
utils/useSomeMagic.ts
export default () => {
const theme = useTheme();
return `/img.${theme.current.value.isDark ? 'dark': 'ligh'}.svg`
}
Once I run npx nuxi generate, everything seems fine and app is running, BUT, where my custom component is loaded, image urls are not converted into ./$src. I guess as image source are defined at runtime, url cannot be converted at buildTime. Is there a way for me to detect that hashMode has been enable, then provide the expected source (ie, ./$src)?
2 replies
NNuxt
Created by kogratte on 7/8/2024 in #❓・help
Referential fetching
Hey there! I'm working on a static app which intend to mimic some behaviours from our online platform. In order to do so, we'll need to fetch our referentials at build time. What would be the best way to do it? Use some bash script to fetch json, then build on top of them? Use virtual files and nuxt hooks? I've not been able to find any example combining hooks and async calls...
1 replies
NNuxt
Created by kogratte on 7/5/2024 in #❓・help
Cannot extend layer
Hello guys! We're working on a brand new product how intend to use the same building blocks than our main app. In order to do so, we want to move common blocks (aka design system, itself based on a layer), onto a shared and reusable package. To achieve that, we create a new layer using nuxi new, then add our first "inner layer" (design system), which itself extends a "child layer", based on vuetify. Our hierarchy looks like that: / /layers/design-system /layers/design-system/layers/vuetify We've been able to use our package through "nuxi dev", we've been able to build it using "nuxi build", and even to pack and publish it through a private npm repository. Now our foundations looks strong, we're trying to install it on our older project as a regular npm dep, and extend is from our main app. It looks like below:
yarn add -D our_shared_package // Which is, in fact, a packaged layer
// Then, in our main nuxt.config.ts
export default defineNuxtConfig({
extends: ['our_shared_package']
});
yarn add -D our_shared_package // Which is, in fact, a packaged layer
// Then, in our main nuxt.config.ts
export default defineNuxtConfig({
extends: ['our_shared_package']
});
But... Rather than working out of the box, nuxi is complaining about `Cannot extends from our_shared_package". I read the documentation again and again, check the package content and so on, and everything looks fine. We do not have a clue concerning what's not going right. Is there a way for us to deep dive into our issue and understand what need to be fixed, where and why?
2 replies
NNuxt
Created by kogratte on 5/27/2024 in #❓・help
Content, Github driver, Auth
Hello guys! Is there a way to fetch content from a private repository using the github driver? How should I pass the auth parameters? I can't find anything...
1 replies
NNuxt
Created by kogratte on 4/10/2024 in #❓・help
Reuse pages?
Good evening! I have a set of pages I would like to use in different locations, without duplications. Let's imagine the global structure. /my-module/ /my-module/a.vue /my-module/b.vue I now want to use those pages in a different context. /context/my-module /context/my-module/a.vue /context/my-module/a.vue Behaviour should remain the same, only context is changing. As those are pages, not components, I'm not sure how to achieve this. Any clue? #layer #pages #reuse
10 replies