📆 Don't miss our Sanity Showcase virtual meetup on March 20th!

React Is Not Defined Following Sanity Upgrade

2 replies
Last updated: Apr 10, 2021
Hello! I wonder if this is a known issue, I just upgraded an older project with
sanity upgrade
and now get
React is not defined
when I try to run it in the browser. The project really isn't complex but I can't seem to find the source of the problem.
Apr 9, 2021, 9:03 AM
Hi
user B
, could you check if there might be a missing React import in your schema definitions or custom components?
Alternatively, could you try removing your
node_modules
folder and
package-lock.json
+
yarn-lock.json
files before running
npm i
and trying once more to start the studio?
Apr 9, 2021, 9:48 AM
Thanks for the hint, I should have known better 😛 - it was a missing import on a custom plugin.
Apr 10, 2021, 8:18 AM

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?

Related answers

Get more help in the community Slack

TopicCategoriesFeaturedRepliesLast Updated
How to turn PortableText into plain text in Javascript?Dec 7, 2020
Rendering nested block contentJan 18, 2021
In the tutorial, there is samples of what the API returns as JSON. Is there a way to view these ?Jan 11, 2021
DOMParser is not defined at defaultParseHtmlDec 3, 2020
Next.js and Vercel - Error! No Output Directory named "dist" foundAug 8, 2022
List Arrays - Is it Possible to Fill a List Array Within a Schema Asynchronously?Mar 16, 2021
Custom Document Views - Is it Even Possible to Use the Structure Builder?Apr 21, 2022
TypeError: Cannot Read Properties of Null (Reading 'jsonType')Sep 28, 2022
Error in custom validation rule for schema in Slack threadAug 18, 2023
How to populate a list of values in a Sanity schema using a separate fileSep 6, 2021

Related contributions

Turbo Start Sanity
- Template

The battle-tested Sanity template that powers Roboto Studio's websites

Go to Turbo Start Sanity

Schema UI - Next.js Sanity Starter
- Template

A Next.js starter template with Next.js 15, Tailwind CSS, shadcn/ui, and Sanity CMS with Live Editing. Get production-ready React components with matching Sanity schemas and queries. Build dynamic pages faster while keeping full control over customization.

Serge Ovcharenko
Go to Schema UI - Next.js Sanity Starter

The Swaddle
- Made with Sanity

A new brand identity to represent a more mature company, to signify The Swaddle’s evolution from publisher to production house, combined with an easier to navigate platform that can surface multiple content types - drawing readers through The Swaddle’s content offering.

Nightjar
Go to The Swaddle