I try to deploy my Gatsby/ wordpress site to netlify but keep having the same issue.
11:06:17 PM: Path: /wp-json
11:06:17 PM: The server response was "404 Not Found"
11:06:17 PM: error Plugin gatsby-source-wordpress returned an error
11:06:17 PM:
11:06:17 PM: TypeError: Cannot read property 'data' of undefined
11:06:17 PM:
11:06:17 PM: - fetch.js:141 fetch
11:06:17 PM: [repo]/[gatsby-source-wordpress]/fetch.js:141:21
11:06:17 PM:
11:06:17 PM: - next_tick.js:68 process._tickCallback
I tried to change my BaseURL but I still get the error.
My gatsby.config :
require('regenerator-runtime/runtime')
require('dotenv').config({
path: '.env',
});
const path = require('path');
module.exports = {
pathPrefix: `/mameri`,
siteMetadata: {
title: `quentinmameri`,
description: `Kick off your next, great Gatsby project with this default starter. This barebones starter ships with the main Gatsby configuration files you might need.`,
author: `@gatsbyjs`,
},
plugins: [
`gatsby-plugin-react-helmet`,
{
resolve: `gatsby-source-filesystem`,
options: {
name: `images`,
path: `${__dirname}/src/images`,
},
},
`gatsby-transformer-sharp`,
`gatsby-plugin-sharp`,
{
resolve: `gatsby-plugin-manifest`,
options: {
name: `gatsby-starter-default`,
short_name: `starter`,
start_url: `/`,
background_color: `#663399`,
theme_color: `#663399`,
display: `minimal-ui`,
icon: `src/images/gatsby-icon.png`, // This path is relative to the root of the site.
},
},
{
resolve: `gatsby-source-wordpress`,
options: {
/*
* The base URL of the Wordpress site without the trailingslash and the protocol. This is required.
* Example : 'gatsbyjsexamplewordpress.wordpress.com' or 'www.example-site.com'
*/
baseUrl: "qmavocats.wordpress.com",
// The protocol. This can be http or https.
protocol: "https",
// Indicates whether the site is hosted on wordpress.com.
// If false, then the assumption is made that the site is self hosted.
// If true, then the plugin will source its content on wordpress.com using the JSON REST API V2.
// If your site is hosted on wordpress.org, then set this to false.
hostingWPCOM: false,
// If useACF is true, then the source plugin will try to import the Wordpress ACF Plugin contents.
// This feature is untested for sites hosted on wordpress.com.
// Defaults to true.
useACF: true,
}
},
// this (optional) plugin enables Progressive Web App + Offline functionality
// To learn more, visit: https://gatsby.dev/offline
// `gatsby-plugin-offline`,
],
}
I dont know why I have this error. Thank for your help.