Unlock seamless workflows and faster delivery with our latest releases - Join the deep dive

Upgrading to Sanity 2.35.0 caused a compilation error due to an issue with the auto-id module.

4 replies
Last updated: Oct 24, 2022
I upgraded to 2.35.0 (from 2.34.0) today, but..
✔ Compiling...
Failed to compile.

Error in ./node_modules/@sanity/form-builder/node_modules/@sanity/ui/node_modules/@reach/auto-id/dist/reach-auto-id.esm.js
Module not found: Error: Can't resolve '@reach/utils/use-isomorphic-layout-effect' in '/Volumes/repos/my-project-sanity/node_modules/@sanity/form-builder/node_modules/@sanity/ui/node_modules/@reach/auto-id/dist'
 @ ./node_modules/@sanity/form-builder/node_modules/@sanity/ui/node_modules/@reach/auto-id/dist/reach-auto-id.esm.js 2:0-86

Oct 24, 2022, 2:08 PM
yarn why @reach/auto-id
yarn why v1.22.10
[1/4] :thinking_face: Why do we have the module "@reach/auto-id"...?
[2/4] :truck: Initialising dependency graph...
[3/4] :mag: Finding dependency...
[4/4] :aerial_tramway: Calculating file sizes...
=> Found "@reach/auto-id@0.13.2"
info Has been hoisted to "@reach/auto-id"
info Reasons this module exists
  - Hoisted from "@sanity#base#@reach#auto-id"
  - Hoisted from "@sanity#default-layout#@reach#auto-id"
  - Hoisted from "@sanity#desk-tool#@reach#auto-id"
  - Hoisted from "@sanity#desk-tool#@sanity#form-builder#@reach#auto-id"
info Disk size without dependencies: "60KB"
info Disk size with unique dependencies: "256KB"
info Disk size with transitive dependencies: "364KB"
info Number of shared dependencies: 5
=> Found "@sanity/ui#@reach/auto-id@0.16.0"
info This module exists because "@sanity#ui" depends on it.
info Disk size without dependencies: "60KB"
info Disk size with unique dependencies: "256KB"
info Disk size with transitive dependencies: "364KB"
info Number of shared dependencies: 5
Oct 24, 2022, 2:09 PM
npx @sanity/cli versions
@sanity/cli                 2.35.0 (up to date)
@sanity/base                2.35.0 (up to date)
@sanity/cli                 2.35.0 (up to date)
@sanity/color-input         2.35.0 (up to date)
@sanity/components          2.14.0 (up to date)
@sanity/core                2.35.0 (up to date)
@sanity/default-layout      2.35.0 (up to date)
@sanity/default-login       2.35.0 (up to date)
@sanity/desk-tool           2.35.0 (up to date)
@sanity/image-url            1.0.1 (up to date)
@sanity/production-preview  2.33.2 (up to date)
@sanity/rich-date-input      2.0.9 (up to date)
@sanity/vision              2.35.0 (up to date)
Oct 24, 2022, 2:09 PM
Might upgrading auto-id to latest (0.18.0) version work? You seem to be on 0.13.2 in one place and 0.16.0 elsewhere (Sanity UI uses latter per above stats)
Oct 24, 2022, 2:20 PM
Eh, good old
rm -rf node_modules
and a re-install fixed it.
Oct 24, 2022, 5:45 PM

Sanity– build remarkable experiences at scale

Sanity is a modern 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?