Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: Cannot read property 'allWordpressPage' of undefined #2

Open
Adrian-Swifter opened this issue Jun 11, 2018 · 6 comments
Open

Comments

@Adrian-Swifter
Copy link

I followed your tutorial and i cant get past this graphql error? Even when i clone your repo, results are same...

@ivandoric
Copy link
Owner

Do you have Wordpress installed? Does it have REST API enabled. This looks to me like Gatsby is not connecting your Wordpress, you need to double check that.

@Adrian-Swifter
Copy link
Author

I have installed wordpress on my local machine and gatsby folder inside worpresss installation...everything worked normally, but when i added gatsby-node.js, page.js and post.js, this error started showing up

@ivandoric
Copy link
Owner

Hmmm, can you try and pin point the file that is causing problems and then paste the code here so I can take a look see. Or maybe just paste all three files if you can't pin point the one that is causing problems.

@dolnma
Copy link

dolnma commented Sep 15, 2018

Hello. Same problem here.

error gatsby-node.js returned an error
  TypeError: Cannot read property 'allWordpressPage' of undefined

I reinstalled WordPress on my local machine (using proxy),but still not working and receiving this type of error.
Here is my gatsby-config.js:

module.exports = {
    siteMetadata: {
        title: 'Wordpress Gatsby',
        subtitle: `Fetch Data From Local WP Install`,
    },
    plugins: [
        'gatsby-plugin-react-helmet',
        {
            resolve: "gatsby-source-wordpress",
            options: {
                baseUrl: "dollyswp.test",
                protocol: "http",
                hostingWPCOM: false,
                useACF: true,
                verboseOutput: true
            }
        },
        'gatsby-transformer-sharp',
        'gatsby-plugin-sharp'
    ],
};

Everything works fine in command line - mean, that fetching from url works well

@8bit-echo
Copy link

I'm running into this issue right now as well, and it looks like the reason I can't connect is because axios throws an error about a self-signed certificate on my localhost. changing to my local vhost and baseURL to http solved my issue.

@DanielBarbakadze
Copy link

I had the same issue, the reason was that in plugins -> options ->
It was: baseUrl: "webpagename", instead of baseUrl: "webpagename.local" (or what domain you're using)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants