Comments (10)
I stumbled upon this while adding limit(n) to my query as well. In middleware.js limit and skip are getting applied before the where clause. This seems to be a bug. See:
Lines 76 to 104 in c5a11fc
from content.
@realityfilter so skip
and limit
probably should be at the very end?
Gonna try it out later and create a PR if it solves the issue. :)
from content.
Thank you @dtmzr and @benjamincanac for keeping it rolling. Well Done !!!
from content.
I see problem might be at where I handle $fetch hook.
when we enter direct URL it runs on server so all goes well. But on client side same effect is not observed :(
Not sure how to handle this properly
from content.
Hey there, I removed this
.skip(this.skipCnt)
.limit(this.limitCnt)
from your query within MainBlock.vue
. It seemed to help and your app delivered the right content in that case.
I guess the pagination mechanism has an unexpected side effect, let me know if you need help looking into it. :)
Heres the example:
https://codesandbox.io/s/nuxt-content-95-x4uyq?file=/pages/index.vue
(Note: due to removing skip/limit the infinite scroll is messed up in this example.)
from content.
@dtmzr Thank you very much for looking into it. Never thought this will be attended by anyone.
I think .limit() creates this issue only when you use along with .search() or .where() conditions.
Why I go with pagination mode is, lets say someone searches for word "veg" I have many tittles which has "veg" in it, so I want to show only 10 posts. so the page loads faster, also related images gets loaded only when the user wants to go down, else I might use my bandwidth of downloading 100 images which is unnecessary. Loading only when user goes down the screen saves the bandwidth in terms of users data as well.
Do you have any other way to manage this?
Thanks
from content.
I looked a little further into it but sadly couldn't resolve the issue.
In your case it seems to go wrong when the client tries to fetch this data, the server seems to retrieve it correctly.
You'll notice that if you reload the page - then the correct data should be in place.
I'll try to create a minimal poc to see if this is an implementation issue.
from content.
Yes I agree with you and realized it happens at client side.
One more thing is this behavior is not observed when I run as offline static site. after yarn generate then yarn serve.
Problem is during development SSR. If you can look into it that will be really helpful.
from content.
Yes. So you can paginate results matching a specific criteria.
from content.
Hey folks,
@benjamincanac just informed me within #267 that this issue should be fixed by #238. So we should be good to go after the next release.
@rajesh-h I tried out your app with the current dev version of content and everything worked as you would expect. 🙏
from content.
Related Issues (20)
- [Landing] - Design review
- want some magic ? An image is switched with another one on client side HOT 2
- Add Default Language Field to Nuxt Config for Shiki Code Highlighting HOT 1
- bug: home page layout shift
- Can't Access Nuxt Studio Data in Frontend of Application HOT 1
- Error on Nuxt Content for Static Site Generation : Document not found, overwrite this content with #not-found slot in <ContentDoc>. HOT 1
- When I set useHead in app.vue, the webpage title does not change after leaving the content-related page
- bug(search): unicode characters display wrong on indexed mode HOT 1
- Unwanted class added on anchor links when target="_self"
- Image path changed in when linking images in markdown content HOT 2
- queryContent matches on start of path not directory name
- Unable to install nuxt with @nuxt/content with pnpm
- Unable to start project after creation (#internal/nitro/virtual/app-config is not defined) HOT 2
- Typecheck fail: Property 'useNuxtImage' does not exist on type HOT 1
- How to disable warnings like this: WARN [Vue warn]: Failed to resolve component: G?
- Unable to start examples/essentials/hello-world example HOT 1
- hook 'content:file:beforeParse' not working
- hook 'content:file:beforeParse' not working
- SSR and client divergence when processing link
- The MDC files are available during development but not after the build process HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from content.