Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: theme.sanity is undefined #67

Closed
millnut opened this issue Feb 23, 2024 · 2 comments
Closed

Error: theme.sanity is undefined #67

millnut opened this issue Feb 23, 2024 · 2 comments

Comments

@millnut
Copy link

millnut commented Feb 23, 2024

When installing and attempting to use the taxonomy manager it throws this error;

The structure tool crashed

Error: theme.sanity is undefined

responsiveStackSpaceStyle@http://localhost:3333/node_modules/.sanity/vite/deps/sanity-plugin-taxonomy-manager.js?v=7637a5e1:16061:7
_e@http://localhost:3333/node_modules/.sanity/vite/deps/sanity-plugin-taxonomy-manager.js?v=7637a5e1:1450:16
e3.prototype.generateAndInjectStyles@http://localhost:3333/node_modules/.sanity/vite/deps/sanity-plugin-taxonomy-manager.js?v=7637a5e1:1318:22
Ye/P2/g5<@http://localhost:3333/node_modules/.sanity/vite/deps/sanity-plugin-taxonomy-manager.js?v=7637a5e1:1567:88
Ye/P2/<@http://localhost:3333/node_modules/.sanity/vite/deps/sanity-plugin-taxonomy-manager.js?v=7637a5e1:1569:8
P2@http://localhost:3333/node_modules/.sanity/vite/deps/sanity-plugin-taxonomy-manager.js?v=7637a5e1:1573:6
renderWithHooks@http://localhost:3333/node_modules/.sanity/vite/deps/chunk-OMHGJEAR.js?v=7637a5e1:16772:36
updateForwardRef@http://localhost:3333/node_modules/.sanity/vite/deps/chunk-OMHGJEAR.js?v=7637a5e1:18928:28
beginWork@http://localhost:3333/node_modules/.sanity/vite/deps/chunk-OMHGJEAR.js?v=7637a5e1:20535:22
beginWork$1@http://localhost:3333/node_modules/.sanity/vite/deps/chunk-OMHGJEAR.js?v=7637a5e1:24350:22
performUnitOfWork@http://localhost:3333/node_modules/.sanity/vite/deps/chunk-OMHGJEAR.js?v=7637a5e1:23795:20
workLoopSync@http://localhost:3333/node_modules/.sanity/vite/deps/chunk-OMHGJEAR.js?v=7637a5e1:23734:30
renderRootSync@http://localhost:3333/node_modules/.sanity/vite/deps/chunk-OMHGJEAR.js?v=7637a5e1:23713:15
recoverFromConcurrentError@http://localhost:3333/node_modules/.sanity/vite/deps/chunk-OMHGJEAR.js?v=7637a5e1:23333:42
performSyncWorkOnRoot@http://localhost:3333/node_modules/.sanity/vite/deps/chunk-OMHGJEAR.js?v=7637a5e1:23476:28
flushSyncCallbacks@http://localhost:3333/node_modules/.sanity/vite/deps/chunk-OMHGJEAR.js?v=7637a5e1:13736:30
node_modules/react-dom/cjs/react-dom.development.js/ensureRootIsScheduled/<@http://localhost:3333/node_modules/.sanity/vite/deps/chunk-OMHGJEAR.js?v=7637a5e1:23224:21

I'm currently running sanity 3.30.0 and these are my current package.json dependencies.

  "dependencies": {
    "@sanity/icons": "^2.6.0",
    "@sanity/ui": "^2.0.0",
    "@sanity/vision": "^3.30.0",
    "react": "^18.2.0",
    "react-dom": "^18.2.0",
    "react-is": "^18.2.0",
    "sanity": "^3.30.0",
    "sanity-plugin-taxonomy-manager": "^3.1.1",
    "styled-components": "^6.0.7"
  },
  "devDependencies": {
    "@sanity/eslint-config-studio": "^3.0.1",
    "@types/react": "^18.0.25",
    "eslint": "^8.6.0",
    "prettier": "^3.0.2",
    "typescript": "^5.1.6"
  },

Downgrading from styled-components 6 to 5.3.11 seems to fix this, so this maybe a compatibility issue with the newest styled-components release

@andybywire
Copy link
Owner

Thanks for filing this issue, @millnut. I've checked this configuration in projects I'm running—with the same version of styled-components on version 3.30.0 of the Studio—and am not seeing this error. I'll do some more investigation to see if I can reproduce this and catch it. In the meantime, if you haven't already, you might try deleting your node_modules and .sanity files and starting with a fresh install. Either way, I'll update you here on what I find.

@millnut
Copy link
Author

millnut commented Feb 26, 2024

Thanks @andybywire removing the .sanity directory and restarting studio has solved the issue with styled-components

@millnut millnut closed this as completed Mar 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants