Victor Neves
[nuxt] Could not access `nitro`
Has anyone faced similar problem?
[nuxt] Could not access
nitro
. The only available runtime config keys on the client side are public
and app
. See https://nuxt.com/docs/guide/going-further/runtime-config
for more information.
To test, I removed the client plugins (even the sever plugins) and also moved all keys into public and still get this warning on the browser console when running dev mode.
Any help would be appreciated
Thanks12 replies
[solved] <NuxtPage name="some-name" /> not working
Hi all
I'm migrating a Vue 3 project to Nuxt 3 and I'm currently facing a problem with making <NuxtPage name="some-name" /> work
Here's a reproduction where you can what I'm trying to achieve.
From what I saw on the docs this is the right way, but not sure if I need to update something on the route structure
https://stackblitz.com/edit/nuxt-starter-z7j8fy?file=app%2Frouter.options.js
Thanks
27 replies
how to generate static HTML pages just for some of the routes
I'm trying to generate 4 static HTML pages from a huge list of routes that the app has
But I only see info for pre-render and a nuxi command (nuxi generate) also for pre-render and not for pure static HTML.
One note, 99,99% of the routes I fetch from the server, and doing that using the
pages:extended
hook as it contains async requests and it was the only way I found to avoid the "double request" (server and then on the client)
Thanks10 replies
add class to default root div __nuxt
Hi, I'm migrating a VUE 3 SSR project to Nuxt 3 and saw that Nuxt adds a rot div that we don't have direct access as we have on Vue as there's no index.html
Looking at the docs I see that we can change the ID and tag name using rootId and rootTag
This has to do with the fact that we have a class applied to that HTML element to put the footer on the bottom of the page when the content on the main "div" isn't enough to fill the page.
Currently, I'm doing it on "jquery" way, but I don't think it's the best way to do it as I didn't see any other option
I'm wondering if something like rootClass couldn't be added to prevent doing the way I had to do it
I would say this would be very helpful
@moderator
thanks
27 replies
Using $fetch inside app folder to get the the list of routes
Currently, I'm using this approach to get the list of the routes
https://nuxt.com/docs/guide/going-further/custom-routing#router-options
Looking into the docs for me it's not clear if using $fetch inside the app folder to get the list of routes from the server will also triggered on the client or if it works as the useFetch that transfers state from the server to the client
Can someone clarify me on this?
Thanks
2 replies
Vue Suspense component shouldn't be used on Nuxt?
Hi
I'm currently migrating a Vue 3 SSR project to Nuxt 3 and on the current project we are using the Vue Suspense component
But from what I see on the docs, if I didn't get it wrong we should use it in Nuxt, is that right?
Thanks
1 replies
javascript added using useHead is being executed on the server
I have a javascript to be executed on the client to check the browser version and also if some functionalities are available and if not match the criteria we redirect the user to a dedicated page (informing the user that he needs to update the browser)
But I see that the code added to the script tag is being executed on the server and being changed
original:
then turns into:
How can I prevent/fix this?
Thanks
22 replies
Is anyone using application insights with Nuxt 3?
Does anyone have applications insights working with Nuxt to track and log on the client and server?
I'm having problems to setup it for the server and I'm not sure if it's related to the fact that the package doens't have support for ESM
I have created a nitro plugin, but when running the build preview I get an error saying that cannot find the module 'applicationinsights'
This is how we import the module and it's works on our Vue 3 SSR project
`
Thanks
11 replies
server middleware added to nuxt config
Hi all
The docs say "Nuxt will automatically read in any file in the ~/server/middleware to create server middleware for your project."
My question is, should I still added to nuxt.config like this?
Thanks
3 replies
router-view v-slot={ Component }
hi all
I'm working on an SSR project with Vue 3 and since nuxt already has Vue 3 I was trying to do a copy of the project using nuxt.
The project uses a server driven ui approach, so basically everything comes from the server (we don't have defined pages, the content of each page is defined on the backend where the editor chooses the components and the content for each one of them)
So, on app.vue we have something like this:
When I try to run the app I get an error on 'Component'
I already updated the template to this but i still get the same error:
So my question is, what's the correct way to replace the '<router-view v-slot="{ Component }">'?
Thanks
4 replies