Issue with GraphQL Deploy after Sanity update

10 replies
Last updated: Jun 12, 2021
Hi All,
I just did the 2.11 sanity update and I think it’s causing a pretty big roadblock with GraphQL Deploy. When I do a
sanity graphql deploy
I get the following error:

Validating GraphQL APIThis is an experimental API version, which will change without warning and may have serious bugs.

Unhandled rejection: TypeError: Cannot read property 'id' of null

at normalizeOwnUser *****/studio/node_modules/@sanity/base/lib/datastores/user/createUserStore.js:211:14)

at .../studio/node_modules/@sanity/base/lib/datastores/user/createUserStore.js:160:34

at processTicksAndRejections (internal/process/task_queues.js:94:5)

.../studio/node_modules/rxjs/internal/util/hostReportError.js:4

setTimeout(function () { throw err; }, 0);

^

ReferenceError: document is not defined

at MapSubscriber.project *****/studio/node_modules/@sanity/base/lib/datastores/debugParams/debugParams.js:94:149)

at MapSubscriber._next *****/studio/node_modules/rxjs/src/internal/operators/map.ts:84:29)

at MapSubscriber.Subscriber.next *****/studio/node_modules/rxjs/src/internal/Subscriber.ts:99:12)

at MergeMapSubscriber.notifyNext *****/studio/node_modules/rxjs/src/internal/operators/mergeMap.ts:162:22)

at SimpleInnerSubscriber._next *****/studio/node_modules/rxjs/src/internal/innerSubscribe.ts:30:17)

at SimpleInnerSubscriber.Subscriber.next *****/studio/node_modules/rxjs/src/internal/Subscriber.ts:99:12)

at Observable._subscribe *****/studio/node_modules/rxjs/src/internal/util/subscribeToArray.ts:9:16)

at Observable._trySubscribe *****/studio/node_modules/rxjs/src/internal/Observable.ts:238:19)

at Observable.subscribe *****/studio/node_modules/rxjs/src/internal/Observable.ts:219:14)

at Object.innerSubscribe *****/studio/node_modules/rxjs/src/internal/innerSubscribe.ts:111:19)

I tried deleting
yarn.lock
and also
node_modules
and re-running yarn. same error.
Jun 12, 2021, 12:00 AM
Thanks for reporting, I'm looking into it now. For the time being, you might have to downgrade to 2.10.x
Jun 12, 2021, 12:15 AM
Great! Whats the proper sanity downgrade command? Looked around for the proper downgrade method. What I found didn’t seem right. (https://github.com/sanity-io/sanity/issues/478 )
Jun 12, 2021, 12:19 AM
Unfortunately I don't think there is one, I think your best shot is editing
package.json
and modifying the
@sanity/*
-dependencies, eg something like this:

    "@sanity/base": "2.10.x",
    "@sanity/core": "2.10.x",
    "@sanity/default-layout": "2.10.x",
    "@sanity/default-login": "2.10.x",
    "@sanity/desk-tool": "2.10.x",
    "@sanity/vision": "2.10.x",
Then running
sanity install
(or
yarn
, or
npm install
- whatever you prefer)
Jun 12, 2021, 12:23 AM
Thought so. figured I’d make sure. Thanks again.
Jun 12, 2021, 12:24 AM
Do you have any custom input component or other customization, and/or plugins installed? I'm failing to reproduce the error, but I think it's related to importing the user store from some component
Jun 12, 2021, 12:26 AM
One moment. I’ll DM you
Jun 12, 2021, 12:27 AM
Awesome, thanks
Jun 12, 2021, 12:27 AM
Solved in v2.11.1, I believe - let me know if this turns out not to be the case!
Jun 12, 2021, 12:57 AM
Works great. Thanks for the quick update:)
Jun 12, 2021, 1:49 AM
Works great. Thanks for the quick update:)
Jun 12, 2021, 1:49 AM

Sanity– build remarkable experiences at scale

The Sanity Composable Content Cloud is the headless CMS that treats content as data to power your digital business. Free to get started, and pay-as-you-go on all plans.

Was this answer helpful?

Categorized in