ndimatteo / sanity-plugin-vercel-deploy

Custom plugin to trigger webhooks from your Sanity Studio.
MIT License
99 stars 20 forks source link

'Deploy' tab not showing in production #41

Closed sebpowell closed 1 year ago

sebpowell commented 1 year ago

Thank you for this package. I installed it, and it works fine locally – I can see the 'deploy' tab on localhost:3000/studio. However, it doesn't show up when I access the studio on Vercel (myproject.com/studio).

I was wondering whether it might be a setting I need to enable somewhere, but wasn't able to see anything obvious in the docs. Any ideas where I'm going wrong?

This is my package.json:

{
  "name": "next-sanity-test",
  "version": "0.1.0",
  "private": true,
  "scripts": {
    "dev": "next dev",
    "build": "next build",
    "start": "next start",
    "lint": "next lint",
    "ts": "tsc --watch --noEmit"
  },
  "dependencies": {
    "@portabletext/react": "^2.0.2",
    "@sanity/block-content-to-markdown": "^0.0.5",
    "@sanity/code-input": "^4.1.1",
    "@sanity/image-url": "^1.0.2",
    "@sanity/vision": "^3.10.1",
    "@types/node": "18.15.0",
    "@types/react": "18.0.28",
    "@types/react-dom": "18.0.11",
    "eslint": "8.35.0",
    "eslint-config-next": "13.2.3",
    "next": "13.2.3",
    "next-sanity": "^4.3.2",
    "react": "18.2.0",
    "react-dom": "18.2.0",
    "sanity": "^3.10.1",
    "sanity-plugin-vercel-deploy": "^3.3.3",
    "typescript": "4.9.5"
  },
  "devDependencies": {
    "autoprefixer": "^10.4.14",
    "postcss": "^8.4.21",
    "prettier": "^2.8.8",
    "sanity-codegen": "^0.9.8",
    "tailwindcss": "^3.2.7"
  }
}

And this is my sanity.config.ts file:

import { visionTool } from "@sanity/vision";
import { defineConfig } from "sanity";
import { deskTool } from "sanity/desk";
import { codeInput } from "@sanity/code-input";
import { apiVersion, dataset, projectId } from "./sanity/env";
import schemas from "./sanity/schemas";
import { vercelDeployTool } from 'sanity-plugin-vercel-deploy'

export default defineConfig({
  basePath: "/studio",
  projectId,
  dataset,
  schema: {
    types: [...schemas],
  },
  plugins: [
    deskTool(),
    visionTool({ defaultApiVersion: apiVersion }),
    codeInput(),
    vercelDeployTool(),
  ],
});

The tab shows on localhost:

Screenshot 2023-05-12 at 16 49 39

But not on production:

Screenshot 2023-05-12 at 16 49 58

Thank you for your help!

ndimatteo commented 1 year ago

Hey there @sebpowell Sorry to hear you're having trouble getting this to show up in production! I haven't ever experienced this, and there is nothing in the plugin that handles things different depending on environments.

It sounds like an issue with your deployment on Vercel, so I'd start checking there first and make sure your code/branch locally is what's being used on Vercel.

Closing this for now, as this doesn't seem related to the plugin directly, but feel free to open it back up if you uncover more details!

sebpowell commented 1 year ago

@ndimatteo – thanks for replying! Ok great, at least that narrows things down – I'll do some more digging and report back here what the fix was in case it helps anyone else.