I'm migrating my site from gatsby 2 to version 4. It runs perfectly with the gatsby develop
. However, when I run gatsby build
, I got the following error
Error [ERR_IPC_CHANNEL_CLOSED]: Channel closed
at process.target.send (internal/child_process.js:705:16)
at onResult (/Users/h/Desktop/a/node_modules/gatsby-worker/dist/child.js:38:5)
Emitted 'error' event on process instance at:
{
code: 'ERR_IPC_CHANNEL_CLOSED'
}
/Users/h/Desktop/a/node_modules/yoga-layout-prebuilt/yoga-layout/build/Release/nbind.js:53
throw ex;
^
Error [ERR_IPC_CHANNEL_CLOSED]: Channel closed
at process.target.send (internal/child_process.js:705:16)
at onResult (/Users/h/Desktop/a/node_modules/gatsby-worker/dist/child.js:38:5)
Emitted 'error' event on process instance at:
{
code: 'ERR_IPC_CHANNEL_CLOSED'
}
/Users/h/Desktop/a/node_modules/yoga-layout-prebuilt/yoga-layout/build/Release/nbind.js:53
throw ex;
^
Error [ERR_IPC_CHANNEL_CLOSED]: Channel closed
at process.target.send (internal/child_process.js:705:16)
at onResult (/Users/h/Desktop/a/node_modules/gatsby-worker/dist/child.js:38:5)
Emitted 'error' event on process instance at:
{
code: 'ERR_IPC_CHANNEL_CLOSED'
}
Do you know what this error means and possibly how to fix it?
For some reasons, the building time increases dramatically when I migrate my site to gatsby 4
Gatsby 2: Done building in 182.340403886 sec
After upgrading to Gatsby 4: Done building in 385.763567997 sec
I also got these warning when building the site
<w> [webpack.cache.PackFileCacheStrategy] Caching failed for pack: Error: Can't resolve '/Users/ht/Desktop/a/gatsby-node.js' in '/Users/ht/Desktop/a'
<w> while resolving '/Users/ht/Desktop/a/gatsby-node.js' in /Users/ht/Desktop/a as file
⠏ Building Rendering Engines
<w> [webpack.cache.PackFileCacheStrategy] Serializing big strings (2076kiB) impacts deserialization performance (consider using Buffer instead and decode when needed)
Gatsby Info
System:
OS: macOS 11.3.1
CPU: (8) x64 Intel(R) Core(TM) i5-1038NG7 CPU @ 2.00GHz
Shell: 5.8 - /bin/zsh
Binaries:
Node: 14.15.0 - ~/.nvm/versions/node/v14.15.0/bin/node
npm: 6.14.8 - ~/.nvm/versions/node/v14.15.0/bin/npm
Languages:
Python: 2.7.16 - /usr/bin/python
Browsers:
Chrome: 97.0.4692.99
Firefox: 96.0.2
Safari: 14.1
npmPackages:
gatsby: ^4.5.2 => 4.6.0
gatsby-background-image: 1.5.3 => 1.5.3
gatsby-cli: ^3.1.0 => 3.14.2
gatsby-plugin-emotion: ^7.6.0 => 7.6.0
gatsby-plugin-feed: ^4.5.0 => 4.6.0
gatsby-plugin-google-tagmanager: ^4.5.0 => 4.6.0
gatsby-plugin-image: ^2.5.2 => 2.6.0
gatsby-plugin-lodash: ^5.5.0 => 5.6.0
gatsby-plugin-manifest: ^4.5.2 => 4.6.0
gatsby-plugin-react-helmet: ^5.5.0 => 5.6.0
gatsby-plugin-remove-trailing-slashes: ^4.5.0 => 4.6.0
gatsby-plugin-robots-txt: ^1.5.5 => 1.7.0
gatsby-plugin-sentry: ^1.0.1 => 1.0.1
gatsby-plugin-sharp: ^4.5.2 => 4.6.0
gatsby-plugin-sitemap: ^5.5.0 => 5.6.0
gatsby-plugin-typegen: ^2.2.4 => 2.2.4
gatsby-plugin-typescript: ^4.5.2 => 4.6.0
gatsby-remark-external-links: 0.0.4 => 0.0.4
gatsby-source-contentful: ^7.3.2 => 7.4.0
gatsby-source-filesystem: ^4.5.2 => 4.6.0
gatsby-source-workable: ^1.1.1 => 1.1.1
gatsby-transformer-remark: ^5.5.2 => 5.6.0
gatsby-transformer-sharp: ^4.5.0 => 4.6.0
======================= If the build is successful, I have the cache version. If I build the site again without cleaning the cache, I got this error
Encountered an error trying to infer a GraphQL type for: `tagsList___NODE`. There is no corresponding node with the `id` field matching: "10d9531b-cc34-585e-a658-d2bb37977bef,520da789-a4c8-5465-af81-ae9e75d96123,c6c2bd79-1917-5fe8-848d-634c9ea702ce,d16915b0-7e55-5aca-9992-3d8
a780fe7ff,b4e89f32-400e-57a6-aa56-efe29657eae5,f7f9642e-b7c1-5c09-a08e-6bba3f96fa41,96c01237-f7cf-5f35-ad5c-0e05dfbc73cb,d90ffcca-762f-53bc-bd24-ee95402825e7,9d846575-611d-5f13-9002-7061fa697e24,08c8df32-e25b-5242-9f8a-3c429055d998,43475632-a0e5-5e24-a826-d01ce53ff7a4".
Error: Invariant Violation: Encountered an error trying to infer a GraphQL type for: `tagsList___NODE`. There is no corresponding node with the `id` field matching: "10d9531b-cc34-585e-a658-d2bb37977bef,520da789-a4c8-5465-af81-ae9e75d96123,c6c2bd79-1917-5fe8-848d-634c9ea702
ce,d16915b0-7e55-5aca-9992-3d8a780fe7ff,b4e89f32-400e-57a6-aa56-efe29657eae5,f7f9642e-b7c1-5c09-a08e-6bba3f96fa41,96c01237-f7cf-5f35-ad5c-0e05dfbc73cb,d90ffcca-762f-53bc-bd24-ee95402825e7,9d846575-611d-5f13-9002-7061fa697e24,08c8df32-e25b-5242-9f8a-3c429055d998,43475632-a0e
5-5e24-a826-d01ce53ff7a4".
What is tagsList___NODE?
My Page content model in Contentful has a field called 'Tags list' which refers to the Tag model. It works perfectly with Gatsby version 2.
And I query the tagsList in the code
const productsData = await graphql<any>(`
query {
allContentfulPageProduct(filter: { page: { elemMatch: { slug: { ne: null } } } }) {
nodes {
externalId
page {
slug
tagsList {
name
}
}
blogSlugs
}
}
}
`);
Gatsby/gatsby-source-contentful automatically created a schema for me
type ContentfulTag implements ContentfulReference & ContentfulEntry & Node @derivedTypes @dontInfer {
contentful_id: String!
node_locale: String!
name: String
page: [ContentfulPage] @link(by: "id", from: "page___NODE")
spaceId: String
createdAt: Date @dateformat
updatedAt: Date @dateformat
sys: ContentfulTagSys
}
type ContentfulPage implements ContentfulReference & ContentfulEntry & Node @derivedTypes @dontInfer {
contentful_id: String!
node_locale: String!
metaTitle: String
slug: String
content: ContentfulPageAboutContentfulPageBusinessValueCalculatorContentfulPageCareersContentfulPageCaseStudiesContentfulPageCloudContentfulPageClusterContentfulPageDevopsContentfulPageExpPostgresqlContentfulPageHomeContentfulPageIntegrationsContentfulPageNewsletterContentfulPageObservabilityContentfulPageOpenSourceContentfulPagePartnersContentfulPagePlansAndPricingContentfulPageProductContentfulPageSecurityAndComplianceContentfulPageSimpleContentContentfulPageSolutionContentfulPageSolutionType3ContentfulPageSolutionsContentfulPageSolutionsRetailContentfulPageTimeSeriesContentfulPageTimeSeriesChild1ContentfulPageTimeSeriesChildPage3ContentfulPageTimeSeriesChildPage4ContentfulPageTimeSeriesResourcesUnion @link(by: "id", from: "content___NODE")
metaDescription: contentfulPageMetaDescriptionTextNode @link(by: "id", from: "metaDescription___NODE")
spaceId: String
createdAt: Date @dateformat
updatedAt: Date @dateformat
sys: ContentfulPageSys
tagsList: [ContentfulTag] @link(by: "id", from: "tagsList___NODE")
}
After some debugging, the issue seems to be related to the Contentful source plugin (gatsby-source-contentful
) according to some GitHub threads and to the capability to create internal IDs for tag
node (tags___NODE
).
Aside of waiting the resolution you can try updating the plugin to the latest version.