Comments (10)
Hi there,
I wonder how manelgarcia solved this?
I seem to have run into a similar issue. "group" is defined when in develop mode and all works well, but with gatsby build I get WebpackError: TypeError: Cannot read property 'map' of undefined
My component starts like this:
const Press = ({ data, pathContext }) => {
// pagination. See gatsby node for loading of pathContext.
const { group, index, first, last} = pathContext;
Any clues as to what could be the issue?
UPDATE
The issue that I had was that my template was in the pages folder, and so I just had to move it the the templates folder - sorry, it was an obvious issue that I had missed!
from gatsby-paginate.
I am seeing this now after updating the package on a test blog i'm using. Will investigate and get back shortly.
from gatsby-paginate.
I am not having the same issue it turns out.
If you set a breakpoint in dev tools on this line const { group, index, first, last, pageCount } = this.props.pathContext
- what does your props obj look like?
from gatsby-paginate.
So now it's running into the issue when I'm in develop mode :/
Here's what the props object looks like
from gatsby-paginate.
Here's an repo of the code i'm testing on: https://github.com/AnalogMemory/gatsby-paginate-test/
from gatsby-paginate.
@AnalogMemory I'll pull down that repo and have a look this evening if the kids don't exhaust me too much!
from gatsby-paginate.
@pixelstew Hey man, any update on this? I'm having the same issue.
from gatsby-paginate.
Updated: Problem solved. Sorryp & Thanks for the work!
from gatsby-paginate.
I think this is how I got it solved 🤔
from gatsby-paginate.
I am running into the same issue. Here is the build output. You can see both PageContext and PathContext is empty but if I console.log the data in gatsby-node before passing it to paginate, the data is there.
no groups { path: '/',
11:28:34 AM: '': 'archive',
11:28:34 AM: uri: '/',
11:28:34 AM: location: { pathname: '/archive/', search: '', hash: '' },
11:28:34 AM: navigate: [Function: navigate],
11:28:34 AM: children: undefined,
11:28:34 AM: pageContext: {},
11:28:34 AM: pathContext: {} }
11:28:34 AM: no groups { path: '/',
11:28:34 AM: '': 'immigration-posts',
11:28:34 AM: uri: '/',
11:28:34 AM: location: { pathname: '/immigration-posts', search: '', hash: '' },
11:28:34 AM: navigate: [Function: navigate],
11:28:34 AM: children: undefined,
11:28:35 AM: pathContext: undefined }
11:28:35 AM: no groups { path: '/',
11:28:35 AM: '': 'immigration-posts/page/2',
11:28:35 AM: uri: '/',
11:28:35 AM: location:
11:28:35 AM: { pathname: '/immigration-posts/page/2/', search: '', hash: '' },
11:28:35 AM: navigate: [Function: navigate],
11:28:35 AM: children: undefined,
11:28:35 AM: pathContext: undefined }
from gatsby-paginate.
Related Issues (20)
- An example? HOT 4
- License HOT 1
- Can I create a paginate for both index and other pages HOT 11
- Path Prefix is ignored for first page HOT 3
- Is the template for the index page or for the post? HOT 1
- Allow to pass custom context HOT 2
- Using Gatsby-Image with Gatsby-Paginate HOT 4
- Wrong paginated index paths after refreshing a page
- Unable to use passed context in graphQL query HOT 6
- Layouts are not applied to templated pages HOT 1
- How to add searching to gatsby-paginate? HOT 2
- Show two posts, but only paginate one
- how can i paginate a tag page?
- Application crashes when refreshing from first page of pagination HOT 2
- Pagination only works on pathPrefix/2 and break on pathPrefix HOT 1
- Empty path calculated for first page breaking build HOT 2
- createPaginatedPages should pass ‘count’ parameter to template for ease of use. HOT 1
- 求demo…… HOT 2
- Create post listing not at project root HOT 3
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 gatsby-paginate.