You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/gatsby-source-filesystem/README.md
+18-21Lines changed: 18 additions & 21 deletions
Original file line number
Diff line number
Diff line change
@@ -166,7 +166,6 @@ While downloading the assets, special characters (regex: `/:|\/|\*|\?|"|<|>|\||\
166
166
167
167
**Warning**: Please make sure to pass in the `parentNodeId`. Otherwise if the parent of the created file node is loaded from the cache, the linked file node won't be recreated which means it will be garbage collected and your file is set to null.
168
168
169
-
170
169
```javascript
171
170
createRemoteFileNode({
172
171
// The source url of the remote file
@@ -268,72 +267,70 @@ The `createFileNodeFromBuffer` helper accepts a `Buffer`, caches its contents to
268
267
269
268
**Warning**: Please make sure to pass in the `parentNodeId`. Otherwise if the parent of the created file node is loaded from the cache, the linked file node won't be recreated which means it will be garbage collected and your file is set to null.
270
269
271
-
272
270
#### Example usage
273
271
274
272
The following example is a common case where you want to create a sharing image dynamically, instead of loading an existing image.
### File nodes are null after starting the server a second time
331
-
In case you see yourself running `gatsby clean` frequently to files that are set to `null` you might might have forgotten to pass in `parentNodeId` to `createFileNodeFromBuffer` or `createRemoteFileNode`. Make sure you always provide a parent reference otherwise the files won't be recreated which means it will be garbage collected and show up as `null` in your queried data.
327
+
328
+
In case you see yourself running `gatsby clean` frequently to files that are set to `null` you might might have forgotten to pass in `parentNodeId` to `createFileNodeFromBuffer` or `createRemoteFileNode`. Make sure you always provide a parent reference otherwise the files won't be recreated which means it will be garbage collected and show up as `null` in your queried data.
332
329
333
330
### Spotty network
331
+
334
332
In case that due to spotty network, or slow connection, some remote files fail to download. Even after multiple retries and adjusting concurrent downloads, you can adjust timeout and retry settings with these environment variables:
Copy file name to clipboardExpand all lines: packages/gatsby-source-filesystem/src/create-file-node-from-buffer.js
+4-3Lines changed: 4 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -148,9 +148,10 @@ module.exports = ({
148
148
)
149
149
}
150
150
151
-
152
-
if(typeofparentNodeId===null){
153
-
console.warn(`It seems that you forgot to pass in 'parentNodeId' for a file you try to create with 'create-file-node-from-buffer'. Not doing this is causing problems as a) when the server is restarted, if the parent of the created file node is loaded from the cache, the linked file node won't be recreated which means it will be garbage collected and b) if a parent node is deleted, the linked file node won't also be deleted.`)
151
+
if(parentNodeId===null){
152
+
console.warn(
153
+
`It seems that you forgot to pass in 'parentNodeId' for a file you try to create with 'createFileNodeFromBuffer'. Not doing this is causing problems as a) when the server is restarted, if the parent of the created file node is loaded from the cache, the linked file node won't be recreated which means it will be garbage collected and b) if a parent node is deleted, the linked file node won't also be deleted.`
Copy file name to clipboardExpand all lines: packages/gatsby-source-filesystem/src/create-remote-file-node.js
+4-2Lines changed: 4 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -237,8 +237,10 @@ module.exports = function createRemoteFileNode({
237
237
)
238
238
}
239
239
240
-
if(typeofparentNodeId===null){
241
-
console.warn(`It seems that you forgot to pass in 'parentNodeId' for a file you try to create with 'create-remote-file-node'. Not doing this is causing problems as a) when the server is restarted, if the parent of the created file node is loaded from the cache, the linked file node won't be recreated which means it will be garbage collected and b) if a parent node is deleted, the linked File node won't also be deleted.`)
240
+
if(parentNodeId===null){
241
+
console.warn(
242
+
`It seems that you forgot to pass in 'parentNodeId' for a file you try to create with 'createRemoteFileNode'. Not doing this is causing problems as a) when the server is restarted, if the parent of the created file node is loaded from the cache, the linked file node won't be recreated which means it will be garbage collected and b) if a parent node is deleted, the linked File node won't also be deleted.`
243
+
)
242
244
}
243
245
244
246
// Check if we already requested node for this remote file
0 commit comments