Coder Social home page Coder Social logo

Comments (10)

alexiscott avatar alexiscott commented on July 29, 2024 3

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.

pixelstew avatar pixelstew commented on July 29, 2024 1

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.

pixelstew avatar pixelstew commented on July 29, 2024

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.

AnalogMemory avatar AnalogMemory commented on July 29, 2024

So now it's running into the issue when I'm in develop mode :/

Here's what the props object looks like

screen shot 2018-01-16 at 1 27 40 pm

from gatsby-paginate.

AnalogMemory avatar AnalogMemory commented on July 29, 2024

Here's an repo of the code i'm testing on: https://github.com/AnalogMemory/gatsby-paginate-test/

from gatsby-paginate.

pixelstew avatar pixelstew commented on July 29, 2024

@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.

tomalexhughes avatar tomalexhughes commented on July 29, 2024

@pixelstew Hey man, any update on this? I'm having the same issue.

from gatsby-paginate.

manelet avatar manelet commented on July 29, 2024

Updated: Problem solved. Sorryp & Thanks for the work!

from gatsby-paginate.

manelet avatar manelet commented on July 29, 2024

I think this is how I got it solved 🤔

from gatsby-paginate.

rotexhawk avatar rotexhawk commented on July 29, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.