Currently I have a first version of the site online. In parallel I'm developing a new slice. So I need to create it on Prismic. But the update of prismic trigger the build, and then my online website contains error like that:
Prismic API references a
slice_type that could not be matched by the SliceZone.
Did you register libraries path correctly?
Indeed the slice code isn't pushed on the master yet, but it wouldn't be an issue without the default slice ui.
How to disable the default NotFound slice ? Or maybe I'm doing something wrong in the current workflow ?
Hi @lateek35_nature, what type of webhook is configured on your site?
It is normal for a build to be done if it is detected that a document is updated. There should be no problem if what you do is just create a new Custom Type or update an existing model, the only problem would be is you try to preview a document with a component that doesn't exist in the front-end.
Could you tell us a little more about your use case?
Perhaps my question is more of a workflow issue. I don't really know. But basically, to keep it simple, I have 2 versions of my site:
- the production version
- the development version
and my prismic.
At the moment, I'm building a new slice on the development environment. No problem here, I created my slice with the slicemachine, added the code, and everything works.
A modification on the prismic triggers the deployment. So everything works fine, and as intended, my preview url of the development branch is updated with my new slice.
But on the other hand, the production branch (which has not yet received the merge) is also build (as intended). But I see this section in my page, saying that the slice does not exist, which is true ! But I just want it to skip if the component wasn't found, not breaking my UI. I mean at least have the possibility to hide this information when I'm in production mode.
Or maybe I got the wrong workflow ?
@lateek35_naturo, I've tried it out on my end and I'm not seeing the same error. Could you share a screen recording of it?
In any case, I'm thinking this is the expected behaviour if you're publishing documents, because the builds work with the published data. Are you using the preview functionality with releases?
@Pau That could be the expected behaviour, so it's mean I'm not using the correct workflow, but what is the correct one ?
So to sum up, I've got my website live, and I want to create a new slice. How should I proceed in order to develop my slice on my localhost, without having this error appearing on my livewebsite.
It sounds like you must create a development environment in both GitHub and your repository.
So, on GitHub, the staging changes would need to be in a separate branch, and your changes in Prismic inside a release. This way, you can plan and schedule your content changes and preview and test them before publishing.