Closed pixelass closed 6 months ago
Not sure if noteworthy:
+-- @sanity/vision@3.18.1
| +-- @rexxars/react-json-inspector@8.0.1
| | `-- react@18.2.0 deduped
| +-- @rexxars/react-split-pane@0.1.93
| | `-- react@18.2.0 deduped
| +-- @sanity/icons@2.6.0
| | `-- react@18.2.0 deduped
| +-- @sanity/ui@1.8.3
| | +-- @floating-ui/react-dom@2.0.0
| | | `-- react@18.2.0 deduped
| | `-- react@18.2.0 deduped
| +-- @uiw/react-codemirror@4.21.20
| | `-- react@18.2.0 deduped
| `-- react@18.2.0 deduped
+-- next-sanity@5.5.8
| +-- @sanity/preview-kit@3.2.0
| | `-- react@18.2.0 deduped
| `-- react@18.2.0 deduped
+-- next@13.5.4
| +-- react@18.2.0 deduped
| `-- styled-jsx@5.1.1
| `-- react@18.2.0 deduped
+-- react-dom@18.2.0
| `-- react@18.2.0 deduped
+-- react@18.2.0
+-- sanity@3.18.1
| +-- @dnd-kit/core@6.0.8
| | +-- @dnd-kit/accessibility@3.0.1
| | | `-- react@18.2.0 deduped
| | `-- react@18.2.0 deduped
| +-- @dnd-kit/modifiers@6.0.1
| | `-- react@18.2.0 deduped
| +-- @dnd-kit/sortable@7.0.2
| | `-- react@18.2.0 deduped
| +-- @dnd-kit/utilities@3.2.1
| | `-- react@18.2.0 deduped
| +-- @sanity/logos@2.1.2
| | `-- react@18.2.0 deduped
| +-- @sanity/portable-text-editor@3.18.1
| | +-- react@18.2.0 deduped
| | `-- slate-react@0.98.1
| | +-- use-callback-ref@1.3.0
| | | `-- react@18.2.0 deduped
| | `-- use-sidecar@1.1.2
| | `-- react@18.2.0 deduped
| +-- react-refractor@2.1.7
| | `-- react@18.2.0 deduped
| +-- react-rx@2.1.3
| | `-- react@18.2.0 deduped
| +-- react@18.2.0 deduped
| +-- use-device-pixel-ratio@1.1.2
| | `-- react@18.2.0 deduped
| +-- use-hot-module-reload@1.0.3
| | `-- react@18.2.0 deduped
| `-- use-sync-external-store@1.2.0
| `-- react@18.2.0 deduped
`-- styled-components@5.2.3
`-- react@18.2.0 deduped
+-- @sanity/vision@3.18.1
| +-- @rexxars/react-split-pane@0.1.93
| | `-- react-dom@18.2.0 deduped
| +-- @sanity/ui@1.8.3
| | +-- @floating-ui/react-dom@2.0.0
| | | `-- react-dom@18.2.0 deduped
| | `-- react-dom@18.2.0 deduped
| `-- @uiw/react-codemirror@4.21.20
| `-- react-dom@18.2.0 deduped
+-- next@13.5.4
| `-- react-dom@18.2.0 deduped
+-- react-dom@18.2.0
+-- sanity@3.18.1
| +-- @dnd-kit/core@6.0.8
| | `-- react-dom@18.2.0 deduped
| +-- @sanity/portable-text-editor@3.18.1
| | `-- slate-react@0.98.1
| | `-- react-dom@18.2.0 deduped
| +-- framer-motion@10.16.4
| | `-- react-dom@18.2.0 deduped
| `-- react-dom@18.2.0 deduped
`-- styled-components@5.2.3
`-- react-dom@18.2.0 deduped
Hi,
Do you have a use client
directive in the page.tsx
file you're loading the studio?
Hi,
Do you have a
use client
directive in thepage.tsx
file you're loading the studio?
We are using the pages directory (no app router)
Everything was generated by sanity
https://github.com/pixelass/sanity-check/blob/main/src/pages/admin/%5B%5B...index%5D%5D.tsx
@stipsan for the sake of complete testing I added a second reproduction where I used the app-router: https://github.com/pixelass/sanity-check-2
The process was as follows:
npx create next app
npm create sanity@latest -- --project XXX --dataset production --provider github
/admin
as routenpm run dev
/admin
There are no logs in the web console but there are hook warnings in the node console.
1st reproduction (pages dir): https://github.com/pixelass/sanity-check
2nd reproduction (app dir): https://github.com/pixelass/sanity-check-2
Describe the bug
After adding SanityStudio in my Next.js app I get warings:
To Reproduce
Steps to reproduce the behavior:
npx create next app
npm create sanity@latest -- --project XXX --dataset production --provider github
/admin
as route/admin
npm run dev
Or
git clone git@github.com:pixelass/sanity-check.git
npm i
/admin
npm run dev
Expected behavior
A clear and concise description of what you expected to happen.
I expect NO warnings about invalid hook calls
Which versions of Sanity are you using?
What operating system are you using?
(irrelevant)
Which versions of Node.js / npm are you running?
Additional context
I prepared a Reproduction Repo following the steps above.
No additional setup was done. This is as vanilla as it gets.
Link: https://github.com/pixelass/sanity-check
realted to https://github.com/sanity-io/next-sanity/issues/665