Closed Masadow closed 4 years ago
experiencing the same problem.
I Had the same issue. Turning off the gastby incremental builds in Netlify seems to have fixed the issue
@shansmith01 maybe Netlify does a gatsby clean before building ?
I'm building with CI tools and not using incremental builds. Even building on my computer locally produce the same result.
@shansmith01 maybe Netlify does a gatsby clean before building ?
I'm building with CI tools and not using incremental builds. Even building on my computer locally produce the same result.
I'm having the same issue locally and on CircleCI builds as well. If I cancel the develop process locally and retry I do not get any errors.
@shansmith01 @Masadow @dante-blitz I think this issue is related to incremental builds, it was working for me momentarily in Netlify. I manage my content in DatoCMS which is supposed to be supported by incremental builds.
Hello, sorry but I'm not able to reproduce your issue locally.
If you can reproduce locally can you please provide me the exact steps that you are taking together with the versions of Gatsby and our source plugin? Thank you!
@matjack1 I am using version 2.2.4 of gatsby-source-datocms with gatsby version 2.4.2
When I rebuild my site locally and push to netlify, it works. When I push a content update in DatoCMS w/incremental builds implemented, it fails.
@PHironaka by incremental builds you mean the Gatsby cache plugin in Netlify?
@matjack1 yes
I'm also having the same issue. I can reproduce locally by simply running the build command twice. However, if I delete my .cache
folder it seems to work fine. The error happens if I run a build locally, then try to run another build without deleting the .cache
folder.
Hi @matjack1 , this issue is not related to incremental build for me as I don't use it.
However, what seems to be causing the issue is to have unpublished items in dato but still building fetching this data (for staging env for instance)
Thank you very much for the last hint @Masadow I've reproduced with the draft/published in place. We are going to fix it as soon as possible!
Sorry can you please try a yarn upgrade
/npm upgrade
?
I've done that and it fixed all my issues :(
It might be a dependency below the surface causing problems? Can anyone confirm please?
@matjack1 thanks for helping. I deleted my node modules and ran npm upgrade
, unfortunately still getting the same error message. I also tried deleted my unpublished drafts, cleared cache on Netlify which produced a successful published build. Then tried making another content update in Dato which produced the failed build.
I've been having the same issue since yesterday. I can do a build on Netlify only if I manually press the "Clear cache and deploy" button.
If I just update the content on DATO the build on Netlify fails.
Here's the error on the build process:
Error: The plugin "gatsby-source-datocms" deleted a node of a type owned by an other plugin. The node type "DatoCmsField" is owned by "undefined". The node object passed to "deleteNode": { "id": "DatoCmsField-1026963", "parent": null, "children": [], "internal": { "type": "DatoCmsField", "contentDigest": "64bc17cb46a0c0e43c824c3e94327726", "counter": 65, "owner": "gatsby-source-datocms" }, "label": "Título", "fieldType": "string", "apiKey": "titulo", "localized": false, "validators": { "required": {} }, "position": 1, "appeareance": { "addons": [], "editor": "single_line", "parameters": { "heading": false } }, "defaultValue": null, "originalId": "1026963" } The plugin deleting the node: { "resolve": "/opt/build/repo/node_modules/gatsby-source-datocms", "id": "13634124-684a-5f85-ab6e-0cf0a941c125", "name": "gatsby-source-datocms", "version": "2.2.4", "pluginOptions": { "plugins": [], "apiToken": "eba6671d72345c02e8573ae208eed0", "previewMode": false, "disableLiveReload": false }, "nodeAPIs": [ "createSchemaCustomization", "sourceNodes" ], "browserAPIs": [], "ssrAPIs": [], "pluginFilepath": "/opt/build/repo/node_modules/gatsby-source-datocms" }
I get the same error after updating dependencies.
gatsby
.gatsby-source-datocms
and react-helmet
.@matjack1 thank you for the PR that addresses this issue! Do you have a timeframe for when this PR will be merged and a new release made?
Okay here's my variation on the issue:
I'm trying to execute yarn build. I want to push to Github Pages. I am not using Netlify so those suggestions are neither here nor there with respect to my problem. I am still new to the platform so this is a pretty confusing error to get after following all of the instructions outlined here: https://www.gatsbyjs.org/docs/quick-start/ and here: https://github.com/datocms/gatsby-portfolio
As far as I can tell, Yarn reports that my dependencies are good. Says everything is up to date when I try to run Yarn install again in the repo path. Yarn upgrade having been done, it still gives me the same error. I am not using NPM to manage the packages on this run of the repo, and having used NPM before, it still threw the same error. I don't think it has much to do with that.
I don't have any such folder anywhere in my repo directories called ".cache" to delete so I'm not sure that I can follow those instructions. Let me know what I'm looking for.
To build this repo in the first place, I started by cloning this repo: https://github.com/datocms/gatsby-portfolio and then $ yarn add gatsby-cli $ yarn install $ echo 'DATO_API_TOKEN=fbc18b6a712b88fbb7d5b2dd3c610f' >> .env $ yarn develop -- WORKED at this point, so I CTRL-C terminated the process and tried to $ yarn build
ERROR #11321 PLUGIN
"gatsby-source-datocms" threw an error while running the sourceNodes lifecycle:
The plugin "gatsby-source-datocms" deleted a node of a type owned by another plugin.
The node type "DatoCmsField" is owned by "undefined".
The node object passed to "deleteNode":
{
"id": "DatoCmsField-1044934",
"parent": null,
"children": [],
"internal": {
"type": "DatoCmsField",
"contentDigest": "258217ba587ce6a3eff553e11f679df0",
"counter": 37,
"owner": "gatsby-source-datocms"
},
"label": "SEO Settings",
"fieldType": "seo",
"apiKey": "seo_settings",
"localized": false,
"validators": {},
"position": 2,
"appeareance": {
"addons": [],
"editor": "seo",
"parameters": {}
},
"defaultValue": null,
"originalId": "1044934"
}
The plugin deleting the node:
{
"resolve": "/Users/blain/blaininc.github.io/node_modules/gatsby-source-datocms",
"id": "e15658cd-c6f7-5c68-80d4-bb3d82c23a2b",
"name": "gatsby-source-datocms",
"version": "2.2.4",
"pluginOptions": {
"plugins": [],
"apiToken": "fbc18b6a712b88fbb7d5b2dd3c610f"
},
"nodeAPIs": [
"createSchemaCustomization",
"sourceNodes"
],
"browserAPIs": [],
"ssrAPIs": [],
"pluginFilepath": "/Users/blain/blaininc.github.io/node_modules/gatsby-source-datocms"
}
Error: The plugin "gatsby-source-datocms" deleted a node of a type owned by an other plugin. The node type "DatoCmsField" is owned by "undefined". The node object passed to "deleteNode": { "id": "DatoCmsField-1044934", "parent": null, "children": [], "internal": { "type": "DatoCmsField", "contentDigest": "258217ba587ce6a3eff553e11f679df0", "counter": 37, "owner": "gatsby-source-datocms" }, "label": "SEO Settings", "fieldType": "seo", "apiKey": "seo_settings", "localized": false, "validators": {}, "position": 2, "appeareance": { "addons": [], "editor": "seo", "parameters": {} }, "defaultValue": null, "originalId": "1044934" } The plugin deleting the node: { "resolve": "/Users/blain/blaininc.github.io/node_modules/gatsby-source-dat ocms", "id": "e15658cd-c6f7-5c68-80d4-bb3d82c23a2b", "name": "gatsby-source-datocms", "version": "2.2.4", "pluginOptions": { "plugins": [], "apiToken": "fbc18b6a712b88fbb7d5b2dd3c610f" }, "nodeAPIs": [ "createSchemaCustomization", "sourceNodes" ], "browserAPIs": [], "ssrAPIs": [], "pluginFilepath": "/Users/blain/blaininc.github.io/node_modules/gatsby-sou rce-datocms" }
public.js:485 actions.deleteNode [blaininc.github.io]/[gatsby]/dist/redux/actions/public.js:485:70
redux.js:483 [blaininc.github.io]/[redux]/lib/redux.js:483:35
api-runner-node.js:90 Object.doubleBoundActionCreators.(anonymous function).args [as deleteNode] [blaininc.github.io]/[gatsby]/dist/utils/api-runner-node.js:90:20
destroyEntityNode.js:44 [blaininc.github.io]/[gatsby-source-datocms]/hooks/sourceNodes/destroyEntityNode.js:44:23
Array.map
destroyEntityNode.js:40 module.exports [blaininc.github.io]/[gatsby-source-datocms]/hooks/sourceNodes/destroyEntityNode.js:40:19
index.js:158 [blaininc.github.io]/[gatsby-source-datocms]/hooks/sourceNodes/index.js:158:15
Array.forEach
EntitiesRepo.js:130 [blaininc.github.io]/[datocms-client]/lib/local/EntitiesRepo.js:130:25
Array.forEach
EntitiesRepo.js:129 EntitiesRepo.destroyEntities [blaininc.github.io]/[datocms-client]/lib/local/EntitiesRepo.js:129:29
EntitiesRepo.js:90 [blaininc.github.io]/[datocms-client]/lib/local/EntitiesRepo.js:90:18
Array.forEach
EntitiesRepo.js:88 EntitiesRepo.destroyAllEntities [blaininc.github.io]/[datocms-client]/lib/local/EntitiesRepo.js:88:56
Loader.js:93 [blaininc.github.io]/[datocms-client]/lib/local/Loader.js:93:29
next_tick.js:68 process._tickCallback internal/process/next_tick.js:68:7
Please advise. Big thank.
Okay so God knows why but if I run $ yarn add gatsby-transformer-remark
I can then run yarn develop successfully, only once, and it will post a minor error:
/Users/blain/blaininc.github.io/src/components/layout.js 93:19 warning A control must be associated with a text label jsx-a11y/control-has-associated-label
✖ 1 problem (0 errors, 1 warning)
BUT the localhost 8000 will stand up successfully
I cannot run yarn develop a second time, without again running $ yarn add gatsby-transformer-remark
Once I run yarn add gatsby-transformer-remark again I can then run $ yarn build
which then runs a successful build operation with no errors posted.
Bizarre. Why would this work? Why would it stop working unless I reinstall that component again? What is happening there?
@BlainInc could you post your package.json
file or the output of running yarn outdated
so we can see better what you have installed? Also what version of node are you running?
Alright, v2.2.5 of the plugin should hopefully fix the issue, let us know if it works for you guys, and thanks for the help so far!
This worked for me, thank you @stefanoverna !
@stefanoverna neat, I'll try that later.
@BlainInc Beware, you posted your datocms api key token !!!
Hi, I used gatsby clean command and after gatsby build and worked perfectly.
Hi,
After upgrading Gatsby to version 2.22.10 and using this plugin on version 2.2.4, whenever I try to build my app without removing the
.cache/datocms-assets
folder, build fails with the following stack trace: