davestewart
davestewart
Explore posts from servers
NNuxt
Created by davestewart on 6/12/2024 in #❓・help
How come there are so few events in Nuxt UI?
3 replies
NNuxt
Created by Flo on 3/31/2024 in #❓・help
Nuxt Layer: Composable from layer not found
AFAIK autoimports are for core folders only; you'll have to set up layer imports manually. I have used the layer config option components for auto-importing layer components, but I think maybe the imports statement is what you want here. https://nuxt.com/docs/api/nuxt-config#imports I don't know if it's supposed to be absolute paths or folders... the docs never seem to be clear about this. In components, you can use aliases, so might be something like:
// in the layer config
imports: [
'~~/k8s/composables'
]
// in the layer config
imports: [
'~~/k8s/composables'
]
8 replies
NNuxt
Created by davestewart on 4/12/2024 in #❓・help
Nuxt Image in Nuxt Content Assets
For anyone else wondering if it can be done, apparently for now, it cannot: https://twitter.com/danielcroe/status/1779196430055334008
5 replies
NNuxt
Created by davestewart on 4/12/2024 in #❓・help
Nuxt Image in Nuxt Content Assets
Hmm. I can't seem to quite crack this in code. Is there a way to add layers programmatically? Right now I'm attempting to add the extends layer in the module setup, something like this:
const config = nuxt.options._layers[0].config
if (config) {
if (!config.extends) {
config.extends = []
}
config.extends.push('.nuxt/content-assets')
}
const config = nuxt.options._layers[0].config
if (config) {
if (!config.extends) {
config.extends = []
}
config.extends.push('.nuxt/content-assets')
}
At the same time I add the nuxt.config.ts file and the public folder. Clearly a bit hacky, and in Nuxt Image ipxSetup(), the layer is not appearing:
const publicDirs = nuxt.options._layers.map((layer) => { // layers length is 1 not 2
const publicDirs = nuxt.options._layers.map((layer) => { // layers length is 1 not 2
If I add a manual extends in nuxt.config.ts the layer shows in the ipx setup function, and Nuxt Image shows succesfully in the app. I could instruct users to do this manually, but I would love for it just to be transparent.
5 replies
NNuxt
Created by davestewart on 4/12/2024 in #❓・help
Nuxt Image in Nuxt Content Assets
No description
5 replies
NNuxt
Created by davestewart on 4/12/2024 in #❓・help
Nuxt Image in Nuxt Content Assets
Digging a bit deeper, the notes in the Nuxt Image docs might give a clue to why this is so:
For ipxStatic provider, if images weren't crawled during generation (unreachable modals, pages or dynamic runtime size), changing dir from public causes 404 errors.
As such I ran an additional IPX server pointing at the directory I mention above and it does indeed serve the image:
npx ipx serve --dir ./.nuxt/content-assets/public
npx ipx serve --dir ./.nuxt/content-assets/public
http://localhost:3003/w_300&q_50/paths/same/italian-bean-stew.jpg
http://localhost:3003/w_300&q_50/paths/same/italian-bean-stew.jpg
Again, not sure if this is the right approach, but I'm assuming IPX is set up to only serve from one directory at a time, or the instance (createIPX) can only serve one folder at a time... so suspect I need to make a new IPX instance and run that separately: - https://github.com/nuxt/image/blob/main/src/runtime/ipx.ts If any Nuxt Image maintainers are around to point me in the right direction, I would appreciate it. cc @danielroe , @pi0 Thanks.
5 replies
NNuxt
Created by davestewart on 2/18/2024 in #❓・help
generate vs prerender
FWIW I managed to break my Nuxt Content production site by settinging route rules to { isr: true }. Pages load on first navigate, but subsequent navigations to Content pages render your entire content database as the markdown / element node strtucture they're stored in. I don't know enough about ISR to know if this is a bug or expected behaviour, but suspect bug. Don't do this at home, kids!
11 replies
NNuxt
Created by davestewart on 2/18/2024 in #❓・help
generate vs prerender
No description
11 replies
NNuxt
Created by davestewart on 2/18/2024 in #❓・help
generate vs prerender
This article is getting there (it also calls out the docs for lacking info): https://blog.risingstack.com/nuxt-3-rendering-modes/
11 replies
NNuxt
Created by davestewart on 2/18/2024 in #❓・help
generate vs prerender
Thanks for the link, but the topics it covers are more for client side performance, hydration, etc. My Lighthouse performance is already 94; I just want more info on the mechanics of SSR, routeRules, etc. and how it all works together which I think is a bit light in the docs. Looks like there's also { static: true } in Nitro; what is this? How it is it different from prerender? Or should I use { isr: true } ? And for example @manniL / TheAlexLichter demos nitro.prerender.routes; I wonder why this vs Nuxt's own routeRules (which I presume are passed to Nitro anyway). TL;DR I just want more info how all these libs are configured and layered together
11 replies
NNuxt
Created by davestewart on 2/18/2024 in #❓・help
generate vs prerender
I guess I'm wondering if I can do generate and get API endpoints, or if not, what are the most performant settings to choose for an SSR site
11 replies
NNuxt
Created by davestewart on 2/15/2024 in #❓・help
🐛 Nuxt muddling elements in rendered output #bug
It's easy to forget when buried in route rules !
20 replies
NNuxt
Created by davestewart on 2/15/2024 in #❓・help
🐛 Nuxt muddling elements in rendered output #bug
Yeah, experimentalNoScripts did bad things! - killed client-only - killed nuxt-lazy-load 📝 to self
20 replies
NNuxt
Created by davestewart on 2/15/2024 in #❓・help
🐛 Nuxt muddling elements in rendered output #bug
Ah, the experimentalNoScripts setting. OK, will get it all live and see how it looks. Thanks as usual.
20 replies
NNuxt
Created by davestewart on 2/15/2024 in #❓・help
🐛 Nuxt muddling elements in rendered output #bug
It seems routeRules / prerender still hydrates (and causes the error). What's the best way to prevent hydration on a page?
20 replies
NNuxt
Created by davestewart on 2/15/2024 in #❓・help
🐛 Nuxt muddling elements in rendered output #bug
Let me clone the repo and start removing stuff. Credit to this version of Nuxt tho; page transitions are finally up to the speed of VuePress 👏
20 replies
NNuxt
Created by davestewart on 2/15/2024 in #❓・help
🐛 Nuxt muddling elements in rendered output #bug
So that did not solve the problem. I've tried all kinds of things in the meantime, like removing components, markup, etc, etc. constantly rebuilding and re-previewing; it still happens. I guess if this probably is a hydration error, I should just have the server render this route and move on. Is it worth reporting this bug to the Nuxt repo? I couldn't provide a repo, other than allowing maintainers to checkout this commit (it's a private repo).
20 replies
NNuxt
Created by davestewart on 2/15/2024 in #❓・help
🐛 Nuxt muddling elements in rendered output #bug
I'll run an update and report back. 🤞
20 replies
NNuxt
Created by davestewart on 2/15/2024 in #❓・help
🐛 Nuxt muddling elements in rendered output #bug
Hey Alex, yeeah, I think that's probably the best bet, though I've been holding off because of this bug: https://github.com/nuxt/cli/issues/169 https://github.com/davestewart/nuxt-content-assets/issues/49#issuecomment-1719327223 Not sure if you have insight on that? Honestly, I find this situation quite depressing.
20 replies
NNuxt
Created by davestewart on 2/15/2024 in #❓・help
🐛 Nuxt muddling elements in rendered output #bug
No description
20 replies