Slice Error with basic slice in Nuxt 2

Hi,

I'm using Nuxt 2 with Slicemachine 0.6.1 and I'm trying to create a slice as I usually do, and adding the simplest slice with the default title and description fields creates the component in the slices library folder as expected. However, the slicezone component just outputs "Could not find a component for Slice type "text_block"

I've tried multiple times, including completely resetting my slices by deleting them all in my local repo as well as within Prismic using the Custom Type API, but this just happens every time I try adding a new slice in Slice Machine.

The Slice Simulator doesn't render anything either.

How can I troubleshoot this?

Thanks

Hey,

Do you have any other slices in the project that work?

What does your index.js file look like in /slices/?

Hi Jake,

No - I had a few but none of them worked, so I removed them all and started again, adding the simplest one using Slice Machine's default fields Title and Description.

My /slices/index.js is as follows:

// Code generated by Slice Machine. DO NOT EDIT.

import TextBlock from './TextBlock';

export {
	TextBlock,
};

export const components = {
	text_block: TextBlock,
};

Ok thanks,

What does your <SliceZone> component look like in pages?

If you've setup a new project and are using the latest prismicio-vue package you'll need to pass your components to your SliceZone now like:

<SliceZone :slices="content.data.slices" :components="slices" />
...
import { slices } from '~/slices'

Let me know if this helps, if not would you mind sharing a reproducible copy of your repo?

1 Like

Oh - I've just realised I was missing the import of the SliceZone component :grinning:

Thanks for your swift replies, and sorry for the inconvenience!

No problem at all, glad you solved it! :grin: