Skip to content

Commit

Permalink
Fix pnpm support in Sanity example (vercel#63249)
Browse files Browse the repository at this point in the history
As `@sanity/preview-url-secret` wasn't declared as a dependency when
doing:
```bash
pnpm install && pnpm build
```
It would fail to compile:
```bash
Linting and checking validity of types  .Failed to compile.

./app/api/draft/route.tsx:6:36
Type error: Cannot find module '@sanity/preview-url-secret' or its corresponding type declarations.

  4 |  */
  5 |
> 6 | import { validatePreviewUrl } from "@sanity/preview-url-secret";
    |                                    ^
  7 | import { draftMode } from "next/headers";
  8 | import { redirect } from "next/navigation";
  9 |
```
  • Loading branch information
stipsan authored Mar 13, 2024
1 parent 2e19459 commit aeb4d72
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions examples/cms-sanity/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,12 @@
"@sanity/assist": "^2.0.3",
"@sanity/icons": "^2.11.2",
"@sanity/image-url": "^1.0.2",
"@sanity/vision": "^3.32.0",
"@sanity/preview-url-secret": "^1.6.4",
"@sanity/vision": "^3.33.0",
"@tailwindcss/typography": "^0.5.10",
"@types/node": "^20.11.26",
"@types/node": "^20.11.27",
"@types/react": "^18.2.65",
"@types/react-dom": "^18.2.21",
"@types/react-dom": "^18.2.22",
"@vercel/speed-insights": "^1.0.10",
"autoprefixer": "^10.4.18",
"date-fns": "^3.4.0",
Expand All @@ -27,14 +28,15 @@
"react": "^18.2.0",
"react-dom": "^18.2.0",
"rxjs": "^7.8.1",
"sanity": "^3.32.0",
"sanity": "^3.33.0",
"sanity-plugin-asset-source-unsplash": "^2.0.1",
"server-only": "^0.0.1",
"styled-components": "^6.1.8",
"tailwindcss": "^3.4.1",
"typescript": "5.3.3"
},
"devDependencies": {
"@next/env": "latest",
"eslint": "^8.57.0",
"eslint-config-next": "latest"
}
Expand Down

0 comments on commit aeb4d72

Please sign in to comment.