How do I install slicemachine in a Vue project?

Describe your question/issue in detail

I'm trying to install the slice machine in a Vue project. But I get an error on npx @slicemachine/init@latest, can I install it another way? Does this package even exist?

Errors

Not Found - GET https://registry.npmjs.org/@slicemachine%2Fadapter-universal - Not found

'@slicemachine/adapter-universal@latest' is not in this registry.

Hi @timderaaf,

Prismic doesn't support plain Vue projects, you would have to use Nuxt. Thanks for bringing this error to our attention, though, we'll work on signposting this a little bit clearer so you're informed of that when selecting plain Vue instead of running into the error.

Let me know if you need anymore help :slight_smile:

Hm, thanks for replying, I agree this should be streamlined a bit.

Why restrict it to Nuxt though? The client works on Vue itself, why not the slicemachine as wel?

Hi @timderaaf,

I understand your frustration with Slice Machine only integrating with Nuxt. In that regard we're not "actively" restricting Slice Machine to Nuxt, it's more than we only integrate with Nuxt at the moment (along with Next, and SvelteKit, the Nuxt integration of Slice Machine having specificities related to Nuxt that do not apply to Vue.js) until we're confident we can integrate correctly with broader ecosystems like Vue.js to offer the same level of experience and support. We're looking forward to it, but we're not there yet.

In the meantime, here's an unofficial way you could follow to set up Slice Machine with a plain Vue project:

  1. Install nuxt as a dependency
  2. Run Slice Machine init command npx @slicemachine/init@latest
  3. Uninstall nuxt from your dependencies

After that, you should be able to run Slice Machine with a plain Vue project, some elements, especially code generation, won't work well. Please bear in mind that this is an unofficial workaround and that we cannot guarantee any support for it.

Best,
Lucie