ricokahler / sanity-super-pane

The Sanity Desk Tool Pane with Super Powers
sanity-super-pane.vercel.app
MIT License
101 stars 12 forks source link

Error: Toast: missing context value #12

Open jamesryan-dev opened 3 years ago

jamesryan-dev commented 3 years ago
Screenshot 2021-05-23 at 22 16 02

Error Message:

Error: Toast: missing context value
    at useToast (/static/js/app.bundle.js:388458:15)
    at BulkActionsMenu (/static/js/app.bundle.js:373645:85)
    at renderWithHooks (/static/js/vendor.bundle.js:17961:18)
    at mountIndeterminateComponent (/static/js/vendor.bundle.js:20640:13)
    at beginWork (/static/js/vendor.bundle.js:21754:16)
    at HTMLUnknownElement.callCallback (/static/js/vendor.bundle.js:3346:14)
    at Object.invokeGuardedCallbackDev (/static/js/vendor.bundle.js:3395:16)
    at invokeGuardedCallback (/static/js/vendor.bundle.js:3450:31)
    at beginWork$1 (/static/js/vendor.bundle.js:26361:7)
    at performUnitOfWork (/static/js/vendor.bundle.js:25312:12)

stack:

  in BulkActionsMenu (created by SuperPane)
    in div (created by SuperPane)
    in div (created by SuperPane)
    in div (created by SuperPane)
    in SuperPane (created by SuperPaneWrapper)
    in RouterProvider (created by SuperPaneWrapper)
    in SuperPaneWrapper (created by UserComponentPane)
    in div (created by ForwardRef(ScrollContainer))
    in ForwardRef(ScrollContainer) (created by DefaultPane)
    in div (created by DefaultPane)
    in div (created by DefaultPane)
    in LayerProvider (created by LegacyLayerProvider)
    in LegacyLayerProvider (created by DefaultPane)
    in DefaultPane (created by Styleable(DefaultPane))
    in Styleable(DefaultPane) (created by UserComponentPane)
    in UserComponentPane (created by DeskToolPane)
    in DeskToolPane (created by DeskToolPanes)
    in SplitPaneWrapper (created by DeskToolPanes)
    in div (created by Pane)
    in Pane (created by SplitPane)
    in div (created by SplitPane)
    in SplitPane (created by PanesSplitController)
    in div (created by PanesSplitController)
    in div (created by Pane)
    in Pane (created by SplitPane)
    in div (created by SplitPane)
    in SplitPane (created by PanesSplitController)
    in div (created by PanesSplitController)
    in PanesSplitController (created by DeskToolPanes)
    in PortalProvider (created by DeskToolPanes)
    in div (created by DeskToolPanes)
    in DeskToolPanes (created by DeskTool)
    in DeskTool (created by withRouter(DeskTool))
    in withRouter(DeskTool) (created by DeskToolPaneStateSyncer)
    in DeskToolPaneStateSyncer (created by DeskTool)
    in DeskToolFeaturesProvider (created by DeskTool)
    in DeskTool (created by RenderTool)
    in RenderTool (created by SchemaErrorReporter)
    in RouteScope (created by SchemaErrorReporter)
    in div (created by SchemaErrorReporter)
    in div (created by SchemaErrorReporter)
    in div (created by SchemaErrorReporter)
    in SchemaErrorReporter (created by DefaultLayout)
    in DefaultLayout (created by withRouter(DefaultLayout))
    in withRouter(DefaultLayout) (created by DefaultLayoutRoot)
    in RouterProvider (created by DefaultLayoutRoot)
    in LoginWrapper (created by DefaultLayoutRoot)
    in DefaultLayoutRoot (created by AppProvider)
    in div (created by styled.div)
    in styled.div (created by Box)
    in Box (created by Styled(Box))
    in Styled(Box) (created by Card)
    in Ge (created by ThemeProvider)
    in ThemeProvider (created by ThemeColorProvider)
    in ThemeColorProvider (created by Card)
    in Card (created by Styled(Card))
    in Styled(Card) (created by AppProvider)
    in SnackbarProvider (created by AppProvider)
    in ToastProvider (created by AppProvider)
    in LayerProvider (created by AppProvider)
    in PortalProvider (created by AppProvider)
    in UserColorManagerProvider (created by AppProvider)
    in AppProvider (created by SanityRoot)
    in Ge (created by ThemeProvider)
    in ThemeProvider (created by SanityRoot)
    in SanityRoot
    in AppContainer

sanity structure:


import S from "@sanity/desk-tool/structure-builder";
import { BiLoader } from "react-icons/bi";
import { ImStack } from "react-icons/im"
import { BsPersonBoundingBox } from "react-icons/bs";
import { createSuperPane } from 'sanity-super-pane';

export default () =>
  S.list()
    .title("Content")
    .items([
      S.listItem()
        .title("Loading Screen")
        .icon(BiLoader)
        .child(
          S.editor()
            .title("Loading screen")
            .id("loadingScreen")
            .schemaType("loadingScreen")
            .documentId("singleton-loadingScreen")
        ),
        S.listItem().title('Normal List').child(createSuperPane('loadingScreen', S)),

      S.listItem()
      .title("Page Builder")
      .icon(ImStack)
      .child(
        S.editor()
          .title("Page builder")
          .id("page")
          .schemaType("page")
          .documentId("singleton-page")
      ),
      S.listItem()
        .title("About")
        .icon(BsPersonBoundingBox)
        .child(
          S.editor()
            .title("About")
            .id("about")
            .schemaType("about")
            .documentId("singleton-about")
        ),

      ...S.documentTypeListItems().filter(
        (listItem) => !["loadingScreen", "about", "page"].includes(listItem.getId())
      ),
    ]);

Getting this error upon trying to get setup not sure if a bug or not

ricokahler commented 3 years ago

It seems like this is a bug on my end. Can you provide some details on what studio version your using (e.g. the contents of your package.json)? Need to replicate this first!

jamesryan-dev commented 3 years ago
{
  "name": "pmo",
  "private": true,
  "version": "1.0.0",
  "description": "",
  "main": "package.json",
  "author": "James <ommitted@gmail.com>",
  "license": "UNLICENSED",
  "scripts": {
    "start": "sanity start",
    "test": "sanity check",
    "build": "sanity build"
  },
  "keywords": [
    "sanity"
  ],
  "dependencies": {
    "@sanity/base": "^2.3.6",
    "@sanity/cli": "^2.10.0",
    "@sanity/color-input": "^2.2.6",
    "@sanity/components": "^2.2.6",
    "@sanity/core": "^2.3.3",
    "@sanity/dashboard": "^2.2.6",
    "@sanity/default-layout": "^2.3.6",
    "@sanity/default-login": "^2.2.6",
    "@sanity/desk-tool": "^2.3.6",
    "@sanity/ui": "0.32.8",
    "@sanity/vision": "^2.2.6",
    "prop-types": "^15.7",
    "react": "^17.0",
    "react-dom": "^17.0",
    "react-icons": "^4.1.0",
    "sanity-plugin-dark-theme-blue": "^1.0.1",
    "sanity-plugin-mux-input": "^0.3.1",
    "sanity-super-pane": "^1.0.0-alpha.3"
  },
  "devDependencies": {},
  "repository": {
    "type": "git",
    "url": "git@github.com:namesfm/pmo.git"
  }
}
jamesryan-dev commented 3 years ago

Could it be because I've changed my username so the url isn't correct?

 "repository": {
    "type": "git",
    "url": "git@github.com:namesfm/pmo.git"
  }