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
- Remove plasmic-init.ts
- Remove catchall
- Retain plasmic.json
- Execute plasmic sync command to resync everything in codegen.
- Repeat step 4 for upcoming changes
For Loader API
- Remove plasmic.json
- Remove index.ts
- Remove any other page that might get synced due to codegen.
- Retain catchall, so it can utilize the loader API and display components/pages accordingly
- 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.