-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
[gatsby-source-wordpress] error UNHANDLED REJECTION during gatsby build or gatsby develop #2328
Comments
@daviddeejjames Any reason for not migrating to the latest version of
The error message you get says that IDs cannot be integers, we are supposed to prefix them and convert to string so GraphQL naming convention pass. If you can't migrate to v2.x, could you post the content of your @KyleAMathews Is it possible to keep up-to-date v1.x npm package concurrently to v2.x ? If not, should we dismiss bugs related to v1.x and announce it as discontinued ? |
@sebastienfi oh my bad, I thought my npm update would've fixed this, should have double checked that first... seems that updating to the latest version (2.0.10) has not solved the issue and introduced a new error berfore the current one, with the current one still appearing.
As for the gatsby-config.js, here is what I am currently using: module.exports = {
siteMetadata: {
title: `David James`,
subtitle: `Front End Developer`
},
plugins: [
{
// Pull wordpress content from API
resolve: 'gatsby-source-wordpress',
options: {
baseUrl: 'wordpress.dfjames.com',
protocol: 'http',
hostingWPCOM: false,
useACF: true,
// Set verboseOutput to true to display a verbose output on `npm run develop` or `npm run build`
// It can help you debug specific API Endpoints problems
verboseOutput: false,
},
},
`gatsby-plugin-react-helmet`,
{
resolve: `gatsby-plugin-manifest`,
options: {
name: "David James - Front End Developer",
short_name: "David James",
start_url: "/",
background_color: "#111111",
theme_color: "#111111",
display: "minimal-ui",
icons: [
{
src: `/favicons/android-icon-192x192.png`,
sizes: `192x192`,
type: `image/png`,
},
{
src: `/favicons/android-icon-512x512.png`,
sizes: `512x512`,
type: `image/png`,
},
],
},
},
`gatsby-plugin-offline`,
{
resolve: `gatsby-plugin-typography`,
options: {
pathToConfigModule: `src/utils/typography.js`,
}
},
{
resolve: `gatsby-plugin-google-analytics`,
options: {
trackingId: 'UA-91072742-1',
},
},
{
// Does both SASS and Autoprefixing
resolve: `gatsby-plugin-postcss-sass`,
options: {
postCssPlugins: [
require('autoprefixer')
],
precision: 8 // SASS default: 5
}
},
]
} |
On closer inspection the error seems to be occurring on the first instance of building the GraphQL schema, but seems to work without issue if I rerun EDIT: Fixed the length issue by adding a tag to the post :), array "6" issue remains |
@sebastienfi yeah, let's not fix bugs on 1.x, just encourage people to upgrade. |
@sebastienfi @KyleAMathews any updates on this? I have also found since updating to 2.0.10 that the GraphQL to ACF implementation has changed. I now can directly reference the particular fields attached to a page using the
|
@daviddeejjames look at #2392 |
@sebastienfi thats fine, however all my ACF images are set, so this #2392 seems unrelated. In addition I am currently using a single image field on the homepage which is working as expected, its just that the repeater field image is non-existent (even when using the GraphIQL auto-complete). This was not an issue in the original JSON implementation. It seems the image is there in the |
@daviddeejjames Could you please setup a sample site to reproduce this on GitHub and maybe ping me on the Discord when you have a couple hours to debug this together ? https://discord.gg/MpagVNW |
@sebastienfi @KyleAMathews fixed the ACF images issue, recreating the field group seemed to fix it. Thanks for the help before! As for the original issue I posted in this thread
Still exists even with the latest Its not a massive issue for development as it seems that once the Would love to move my site over soon and start creating some more WordPress examples using both 😃 Let me know if there are any more details I can provide or point me in the right direction to debug the issue. Cheers! |
@daviddeejjames could you make a go at debugging this? It's pretty straightforward to setup a Gatsby development environment. Do that, and then add some console.logs to
to see why some of the keys aren't being prefixed. If that doesn't turn up anything, try looking through .cache/redux-state.json to try to find your "6" and see why that isn't being prefixed along with the rest of the data. |
Cheers @KyleAMathews shall give it a go and get back to you |
* Most of the credits goes to @pieh for a better solution that solved the same problems and widely improved code simplicity. #2646 * Made the Media lookup begin at JSON tree root instead of keeping this for ACF Field only. Changed constants names accordingly. * Making thise more generic allorws Custom Post Types to benefit from this improvements and yet unseen objects shapes. * Incorporated fix on bug mentionned here #2646 (comment) * May solve this #2587, this #2492, this #2328
#2648) * Refactored featured_media map for deep nodes * Featured medias coul be nested at any level * The most certain way to have photos works with this version on the plugin is to either name the fiel featured_media or include the image as Post Object. * Fixed bug where in some case the old featured_media field was not deleted. * Update normalize.js.snap * Integrated pieh 's changes * Most of the credits goes to @pieh for a better solution that solved the same problems and widely improved code simplicity. #2646 * Made the Media lookup begin at JSON tree root instead of keeping this for ACF Field only. Changed constants names accordingly. * Making thise more generic allorws Custom Post Types to benefit from this improvements and yet unseen objects shapes. * Incorporated fix on bug mentionned here #2646 (comment) * May solve this #2587, this #2492, this #2328 * Update normalize.js.snap
Hey @sebastienfi and @KyleAMathews, had a decent go at trying to debug this, could not find my mysterious "6" anywhere, all I know is that it breaks first build, but upon retrying the build/develop command (with a .cache existing) I get no errors whatsoever. The closest value I could find was an ID with "96" which happened to be the ID given to my Wordpress User, but this was not causing the error. Even tried creating a fresh completely different Wordpress install without ACF and still ran into this issue. The only thing I can think of is there any issue with pulling from a subdomain? aka If you'd like to have a look at the error, you can just follow the standard Gatsby install on this repo: https://github.com/daviddeejjames/dfjames-gatsby |
Try removing gatsby-plugin-postcss-sass from gatsby-config.js and see if that removes the error. |
@juz501 thanks heaps, ughhh dependency conflicts... workaround for now is to use Doing this I was able to achieve a successful Netlify build (finally) 💖 |
For anyone else who reads this, be advised that your CSS will no longer benefit from |
You can fix this issue by immediately invoking the module function like this |
Due to the high volume of issues, we're closing out older ones without recent activity. Please open a new issue if you need help! |
Seems to occur intermittently when I run
gatsby build
orgatsby develop
, this is occuring locally but also tried to deploy to Netlify and ran into this issue. Seems to work locally if I re-run the command again. Would love to look into it but the error is a bit vague so not sure what step its occurring on.The text was updated successfully, but these errors were encountered: