Plasmic bot using publish button

Hello, I created a blank project and the repo was created by Plasmic Bot using Publish button. After I created a new branch and relinked the repo again (set to push changes to another branch, instead of main), when I’m trying to deploy it to Vercel I’m getting this error.

Error: You cannot define a route with the same specificity as a optional catch-all route ("/" and "/[[...catchall]]").

Thank you.

Hi @brief_warbler,
This usually happens when we accidentally mixup the codegen approach with loader API. Please try deleting index.ts file and it should work.

The / route will then be handled by the loader API within th catchall.

Thank you, I will try now. One more thing, when I created the project the Mode was Loader and when I relinked the repo the mode was Codegen and I wasn’t allowed to change it.

Yeah, I observed the exact same behavior in one of my previous projects. It can be further clarified by the Plasmic team if it’s expected behavior or not.

To stick with a particular approach we can manually cleanup the files accordingly.

For CodeGen

  1. Remove plasmic-init.ts
  2. Remove catchall
  3. Retain plasmic.json
  4. Execute plasmic sync command to resync everything in codegen.
  5. Repeat step 4 for upcoming changes

For Loader API

  1. Remove plasmic.json
  2. Remove index.ts
  3. Remove any other page that might get synced due to codegen.
  4. Retain catchall, so it can utilize the loader API and display components/pages accordingly
  5. Inside plasmic-init.ts, you can use preview:true in development mode to fetch latest changes during development.
1 Like

I will stick with codegen mode since the beginning and I think I will avoid all of those issues

Let me know if the error persists after doing the above changes.

Is working fine with codegen mode.