Sanity Studio won't start – Cannot read property 'sanity' of undefined
See original GitHub issueNOTE: I am getting the same symptoms as this issue (link below), but supposedly it was resolved and to do with factors that don’t seem to apply to my case, from what I can tell. I updated all packages to current versions immediately before the issue started. https://github.com/sanity-io/sanity/issues/2190
Describe the bug
When starting Sanity, after installing the latest versions of all packages as per today (see full list below) I am getting the following error:
Cannot read property 'sanity' of undefined
The error (as in the issue linked to above) seems to be in GlobalStyle.js, L20:
var color = theme.sanity.color.base;
Stack:
TypeError:
at http://localhost:3333/static/js/app.bundle.js:342103:21
at Ne (http://localhost:3333/static/js/app.bundle.js:71079:14925)
at Ne (http://localhost:3333/static/js/app.bundle.js:71079:14698)
at e.t.createStyles (http://localhost:3333/static/js/app.bundle.js:71079:23087)
at e.t.renderStyles (http://localhost:3333/static/js/app.bundle.js:71079:23326)
at h (http://localhost:3333/static/js/app.bundle.js:71079:24669)
at http://localhost:3333/static/js/app.bundle.js:71079:24485
at commitHookEffectListMount (http://localhost:3333/static/js/vendor.bundle.js:22889:26)
at commitLifeCycles (http://localhost:3333/static/js/vendor.bundle.js:22945:9)
at commitLayoutEffects (http://localhost:3333/static/js/vendor.bundle.js:25961:7)
To Reproduce
Steps to reproduce the behavior:
Install the versions listed below and start sanity.
Expected behavior
Sanity starting without issues.
Which versions of Sanity are you using?
These are the dependencies from my package.json:
"@sanity/base": "^2.10.0",
"@sanity/components": "^2.2.6",
"@sanity/core": "^2.10.0",
"@sanity/default-layout": "^2.10.0",
"@sanity/default-login": "^2.8.0",
"@sanity/desk-tool": "^2.10.0",
"@sanity/google-maps-input": "^2.10.0",
"@sanity/structure": "^2.10.0",
"@sanity/vision": "^2.10.0",
"prop-types": "^15.7",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-icons": "^4.2.0"
What operating system are you using?
MacOS Sierra
Which versions of Node.js / npm are you running?
6.14.11 v14.16.0
Additional context
The issue linked to above mentioned a problem to do with conflicting dependencies to Styled Components. I don’t seem to be able to detect that issue in my setup.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:6 (2 by maintainers)
I suspect this relates to
sanity upgrade
using yarn to install dependencies. Could you try removing node_modules and runningnpm install
again?I’m getting a similar error.
this is what I see at the breakpoint. looks like hues is undefined at this point