Failed to save page type

Describe your question/issue in detail

Impacted feature

I’m trying to save changes to a custom type, and the index.json saves properly but the types are not updating/saving.

What steps have you taken to resolve this issue already?

I removed prettier-plugin-tailwindcsss and the types save properly.

Errors

The jam video shows the errors, but I’m also seeing this in my terminal:

Unable to load your Tailwind CSS v3 config: /home/nmastroianni/code/nextjs/lggdprsmc/tailwind.config.ts

You’ll see in my package.json that I’m not using Tailwindcss v3; I am on v4.

Your Role

Hosting provider

Package.json file


{
  "name": "project-name",
  "version": "0.0.3",
  "private": true,
  "scripts": {
    "dev": "concurrently \"bun:next:dev\" \"bun:slicemachine\" --names \"next,slicemachine\" --prefix-colors gray,magenta",
    "next:dev": "next -H 0.0.0.0 -p 3000",
    "build": "next build",
    "start": "next start",
    "lint": "next lint",
    "slicemachine": "start-slicemachine",
    "format": "bunx prettier --write ."
  },
  "dependencies": {
    "@prismicio/client": "7.21.0",
    "@prismicio/next": "2.0.2",
    "@prismicio/react": "3.2.2",
    "@radix-ui/react-avatar": "^1.1.11",
    "@radix-ui/react-slot": "^1.2.4",
    "axios": "^1.13.2",
    "caniuse-lite": "^1.0.30001755",
    "class-variance-authority": "^0.7.1",
    "embla-carousel-autoplay": "^8.6.0",
    "embla-carousel-react": "^8.6.0",
    "lucide-react": "^0.553.0",
    "motion": "^12.23.24",
    "next": "16.0.3",
    "react": "19.2.0",
    "react-dom": "19.2.0",
    "react-hook-form": "^7.66.1",
    "react-icons": "^5.5.0",
    "react-use-measure": "^2.1.7",
    "tailwindcss-animate": "^1.0.7",
    "zod": "^4.1.12"
  },
  "devDependencies": {
    "@slicemachine/adapter-next": "^0.3.86",
    "@tailwindcss/aspect-ratio": "^0.4.2",
    "@tailwindcss/forms": "^0.5.10",
    "@tailwindcss/postcss": "^4.1.17",
    "@tailwindcss/typography": "^0.5.19",
    "@types/node": "^24.10.1",
    "@types/react": "19.2.4",
    "@types/react-dom": "19.2.3",
    "clsx": "^2.1.1",
    "concurrently": "^9.2.1",
    "eslint": "^9.39.1",
    "eslint-config-next": "16.0.3",
    "postcss": "^8.5.6",
    "prettier": "^3.6.2",
    "prettier-plugin-tailwindcss": "^0.7.1",
    "schema-dts": "^1.1.5",
    "slice-machine-ui": "^2.19.1",
    "tailwind-merge": "^3.4.0",
    "tailwindcss": "^4.1.17",
    "typescript": "^5.9.3"
  },
  "overrides": {
    "@types/react": "19.2.4",
    "@types/react-dom": "19.2.3"
  }
}

Steps to reproduce

Hi :slightly_smiling_face:,

Thank you for discovering the prettier-plugin-tailwindcsss cause. @slicemachine/adapter-next runs generated files (including prismicio-types.d.ts) through Prettier to match your project's code style. prettier-plugin-tailwindcss may be erroring due to a breaking change.

Could you do the following to help us debug the issue?

  1. Disable formatting in generated files with the following option in slicemachine.config.json:

      {
        "repositoryName": "example-prismic-repo",
        "libraries": ["./slices"],
    +   "adapter": {
    +     "resolve": "@slicemachine/adapter-next",
    +     "options": {
    +       "format": false
    +     }
    +   },
        "localSliceSimulatorURL": "http://localhost:8000/slice-simulator"
      }
    
  2. Make a change to a page type and save. Your prismicio-types.d.ts file should be updated without an error.

If this solves your problem, we will need to find the exact versioning problem and prioritize a fix.

Thank you,
Xavier

1 Like

I can confirm @xavier.rutayisire that your workaround resulted in a successful saving of the types.

1 Like

I have determined the error was my own after poking around some more. Somehow, I missed some things in the v4 upgrade that threw a monkey wrench in the works.

You’ll notice the first line in my .prettierrc file is the issue:

{
  "tailwindConfig": "./tailwind.config.ts", // this should not be here
  "arrowParens": "avoid",
  "semi": false,
  "singleQuote": true,
  "jsxSingleQuote": false,
  "plugins": ["prettier-plugin-tailwindcss"]
  "tailwindStylesheet": "./src/app/globals.css" // this is the correct config
}

I must be the only one who had this "mess," but the good news is that this is here in case anyone else ends up with the same setup.

Thanks for the help.

2 Likes

Thanks for updating the thread @nf_mastroianni, hopefully it helps someone else down the road!