Closed JanLenoch closed 6 years ago
I'm able to reproduce this and getting it on the first run and every time .cache
the directory is cleared.
I am also seeing this error. Similar environment but am seeing the behavior regardless of the .cache
directory being cleared.
I am also seeing this error. Similar environment but am seeing the behavior regardless of the
.cache
directory being cleared.
same here
Found a behavior in my case that might hint at the underlying issue (I'm on v2 btw gatsby@next -> gatsby@2.0.0-rc.28
)
I'm pulling in multiple AirTable sources (gatsby-source-airtable@2.0.1
) and the table that was throwing this error had a single record which had null values. When I filled all the rows values into the other fields, it no longer threw
@JanLenoch this happens because it this moment gatsby doesn't support class instances when constructing schema
url
field that is missing is instance of TextField
class ( https://github.com/Enngage/kentico-cloud-js/blob/94ce81548f167530c9376e7a852ac733a708e85b/packages/delivery/lib/fields/field-types.ts#L8-L32 ), which gatsby can't handle first time it sees it. But it works on second try because after serializing data to cache and deserializing it again we get plain object with properties which gatsby can handle
I think fastest way forward would be to normalize fields you get from kentico-cloud-delivery
client to plain objects in source plugin. I will try to see if it's feasible to add support for those in gatsby.
Hi @pieh, thanks for looking into it! Having support for classes would be great as this is what our JS SDK produces by default.
@JanLenoch I've hacky checked yesterday and it seems that what we need is really only way to determine when Object is something we would want to handle - just switching our check here https://github.com/gatsbyjs/gatsby/blob/master/packages/gatsby/src/schema/data-tree-utils.js#L174 should be enough to make it work, but not sure what's the best check we can use - switching it to more open _.isObject
(or any stuff that only checks for typeof x === 'object')
could be problematic because we have whole class of Objects that shouldn't be treated as plain objects (like Date, Number, Array, Map, Set, WeakMap, WeakSet, Promise, ArrayBuffer etc)
Hi @pieh , I found a semi-hacky way of passing plain objects to Gatsby while still being able to utilize our JS SDK at the same time. We're currently doing a peer review of my PR that brings the plain objects. In the mid-term future, it would still be great if Gatsby supported class instances. That way, we could avoid this semi-hacky solution. I'll close this one for now and I'll file a new issue to support class instances. Thanks for looking into it.
Description
Occasionally, during the process of building a project with
gatsby develop
an error occurs:"GraphQL Error Unknown field
some field
on typesome type
"It definitely happens every time the project is first run (after initializing it with
npm install
). But, it also happens in other moments, in a random fashion.Steps to reproduce
Expected result
The
update schema
step should be processed without errors.Actual result
Environment
System: OS: Windows 10 CPU: x64 Intel(R) Core(TM) i7-7700 CPU @ 3.60GHz Binaries: npm: 5.6.0 - C:\Program Files\nodejs\npm.CMD Browsers: Edge: 40.15063.674.0 npmPackages: gatsby: ^1.9.277 => 1.9.277 gatsby-link: ^1.6.46 => 1.6.46 gatsby-plugin-react-helmet: ^2.0.11 => 2.0.11
error The system cannot find the path specified.
Error: The system cannot find the path specified.
envinfo.js:1 Function.e.exports.sync [npm]/[gatsby-cli]/[envinfo]/dist/envinfo.js:1:7778
envinfo.js:1 Object.copySync [npm]/[gatsby-cli]/[envinfo]/dist/envinfo.js:1:104976
envinfo.js:1 Object.t.writeSync.e [as writeSync] [npm]/[gatsby-cli]/[envinfo]/dist/envinfo.js:1:123499
envinfo.js:1 [npm]/[gatsby-cli]/[envinfo]/dist/envinfo.js:1:124274
envinfo.js:1 Promise.all.then.e [npm]/[gatsby-cli]/[envinfo]/dist/envinfo.js:1:124289
From previous event:
envinfo.js:1 p [npm]/[gatsby-cli]/[envinfo]/dist/envinfo.js:1:123986
envinfo.js:1 Object.run [npm]/[gatsby-cli]/[envinfo]/dist/envinfo.js:1:125487
create-cli.js:181 Object.handler [npm]/[gatsby-cli]/lib/create-cli.js:181:17
command.js:235 Object.runCommand [npm]/[gatsby-cli]/[yargs]/lib/command.js:235:44
yargs.js:1046 Object.parseArgs [as _parseArgs] [npm]/[gatsby-cli]/[yargs]/yargs.js:1046:30
yargs.js:551 Object.parse [npm]/[gatsby-cli]/[yargs]/yargs.js:551:25
create-cli.js:242 module.exports [npm]/[gatsby-cli]/lib/create-cli.js:242:157
index.js:126 Object.
[npm]/[gatsby-cli]/lib/index.js:126:1
bootstrap_node.js:187 startup bootstrap_node.js:187:16
bootstrap_node.js:608 bootstrap_node.js:608:3
error UNHANDLED REJECTION
Error: The system cannot find the path specified.
envinfo.js:1 Function.e.exports.sync [npm]/[gatsby-cli]/[envinfo]/dist/envinfo.js:1:7778
envinfo.js:1 Object.copySync [npm]/[gatsby-cli]/[envinfo]/dist/envinfo.js:1:104976
envinfo.js:1 Object.t.writeSync.e [as writeSync] [npm]/[gatsby-cli]/[envinfo]/dist/envinfo.js:1:123499
envinfo.js:1 [npm]/[gatsby-cli]/[envinfo]/dist/envinfo.js:1:124274
envinfo.js:1 Promise.all.then.e [npm]/[gatsby-cli]/[envinfo]/dist/envinfo.js:1:124289
From previous event:
envinfo.js:1 p [npm]/[gatsby-cli]/[envinfo]/dist/envinfo.js:1:123986
envinfo.js:1 Object.run [npm]/[gatsby-cli]/[envinfo]/dist/envinfo.js:1:125487
create-cli.js:181 Object.handler [npm]/[gatsby-cli]/lib/create-cli.js:181:17
command.js:235 Object.runCommand [npm]/[gatsby-cli]/[yargs]/lib/command.js:235:44
yargs.js:1046 Object.parseArgs [as _parseArgs] [npm]/[gatsby-cli]/[yargs]/yargs.js:1046:30
yargs.js:551 Object.parse [npm]/[gatsby-cli]/[yargs]/yargs.js:551:25
create-cli.js:242 module.exports [npm]/[gatsby-cli]/lib/create-cli.js:242:157
index.js:126 Object.
[npm]/[gatsby-cli]/lib/index.js:126:1
bootstrap_node.js:187 startup bootstrap_node.js:187:16
bootstrap_node.js:608 bootstrap_node.js:608:3