sanity-io / next-sanity

Sanity.io toolkit for Next.js
https://www.sanity.io/
MIT License
775 stars 93 forks source link

export 'PreviewSuspense' (reexported as 'PreviewSuspense') was not found in '@sanity/preview-kit' #216

Closed trevorpfiz closed 1 year ago

trevorpfiz commented 1 year ago
./node_modules/next-sanity/dist/preview.js
export 'PreviewSuspense' (reexported as 'PreviewSuspense') was not found in '@sanity/preview-kit' (module has no exports)

Import trace for requested module:
./node_modules/next-sanity/dist/preview.js
./app/(learn)/learn/[courseSlug]/[sectionSlug]/[postSlug]/page.tsx

./node_modules/next-sanity/dist/preview.js
export 'definePreview' (reexported as 'definePreview') was not found in '@sanity/preview-kit' (module has no exports)

Import trace for requested module:
./node_modules/next-sanity/dist/preview.js
./app/(learn)/learn/[courseSlug]/[sectionSlug]/[postSlug]/page.tsx

I am not getting this error with nextjs-blog-cms-sanity-v3. Is this error just telling me that something is wrong with the way I set up preview mode? Will keep looking over my files.

Thanks! ❤️

{
  "private": true,
  "scripts": {
    "build": "next build",
    "dev": "next",
    "lint": "next lint",
    "prepare": "husky install",
    "prettier": "prettier --write .",
    "start": "next start"
  },
  "dependencies": {
    "@docsearch/css": "^3.3.0",
    "@docsearch/react": "^3.3.0",
    "@headlessui/react": "^1.7.5",
    "@heroicons/react": "^2.0.13",
    "@next/env": "^13.0.6",
    "@next/font": "^13.0.6",
    "@portabletext/react": "^2.0.0",
    "@sanity/icons": "^2.1.0",
    "@sanity/image-url": "^1.0.1",
    "@sanity/orderable-document-list": "^1.0.2",
    "@sanity/ui": "^1.0.1",
    "@sanity/vision": "^3.0.6",
    "@sanity/webhook": "^2.0.0",
    "@tabler/icons": "^1.116.1",
    "@tailwindcss/line-clamp": "^0.4.2",
    "@vercel/og": "^0.0.21",
    "@web3forms/react": "^1.1.3",
    "class-variance-authority": "^0.4.0",
    "clsx": "^1.2.1",
    "intl-segmenter-polyfill": "^0.4.4",
    "next": "^13.0.6",
    "next-sanity": "^3.1.3",
    "overlayscrollbars": "^2.0.1",
    "overlayscrollbars-react": "^0.5.0",
    "react": "^18.2.0",
    "react-dom": "^18.2.0",
    "react-hook-form-latest": "npm:react-hook-form@^7.40.0",
    "react-is": "^18.2.0",
    "sanitize-html": "^2.7.3",
    "sanity": "^3.0.6",
    "sanity-plugin-asset-source-unsplash": "^1.0.1",
    "sanity-plugin-media": "^2.0.2",
    "satori": "^0.0.44",
    "server-only": "^0.0.1",
    "styled-components": "^5.3.6",
    "suspend-react": "^0.0.8"
  },
  "devDependencies": {
    "@commitlint/cli": "^17.3.0",
    "@commitlint/config-conventional": "^17.3.0",
    "@tailwindcss/forms": "^0.5.3",
    "@types/node": "18.11.12",
    "@types/react": "^18.0.26",
    "@types/react-dom": "^18.0.9",
    "@types/sanitize-html": "^2.6.2",
    "@types/styled-components": "^5.1.26",
    "@typescript-eslint/eslint-plugin": "^5.46.0",
    "@typescript-eslint/parser": "^5.46.0",
    "autoprefixer": "^10.4.13",
    "eslint": "^8.29.0",
    "eslint-config-airbnb": "^19.0.4",
    "eslint-config-airbnb-typescript": "^17.0.0",
    "eslint-config-next": "^13.0.6",
    "eslint-plugin-import": "^2.26.0",
    "eslint-plugin-jsx-a11y": "^6.6.1",
    "eslint-plugin-react": "^7.31.11",
    "eslint-plugin-react-hooks": "^4.6.0",
    "eslint-plugin-storybook": "^0.6.8",
    "husky": "^8.0.2",
    "postcss": "^8.4.19",
    "prettier": "^2.8.1",
    "prettier-plugin-packagejson": "^2.3.0",
    "prettier-plugin-tailwindcss": "^0.2.1",
    "tailwindcss": "^3.2.4",
    "typescript": "^4.9.4"
  },
  "engines": {
    "node": ">=16.0.0",
    "npm": ">=8.3.0",
    "pnpm": "please-use-npm",
    "yarn": "please-use-npm"
  }
}
trevorpfiz commented 1 year ago

Ok... it was just that my auto import was export { PreviewSuspense } from 'next-sanity/preview' instead of import { PreviewSuspense } from '#/components/preview/PreviewSuspense'

Oops🤦