Missing dependencies Nuxt 2 @slicemachine/adapter-nuxt2

Hey

Get this issue when i try to run my dev server. Have runned @slicemachine/init@latest


These dependencies were not found:                       friendly-errors 11:12:49
                                                         friendly-errors 11:12:49
* @prismicio/simulator/kit in ./node_modules/@slicemachine/adapter-nuxt2/dist/simulator/SliceSimulator.cjs
* ~/slices in ./node_modules/babel-loader/lib??ref--2-0!./node_modules/vue-loader/lib??vue-loader-options!./pages/slice-simulator.vue?vue&type=script&lang=js&

Looks like a weird error and i cant find similar

1 Like

Hello Anton,

Welcome to the Prismic community, and thanks for reaching out to us.

I followed this setup article and couldn't reproduce the same error.
What version of node and npm do you have?
I have node -v: v16.15.1 and npm version 9.6.4.

I am looking forward to hearing from you back.

Thanks,
Priyanka

1 Like

Hello, I have exactly the same issue :frowning:

node v16.15.0
nuxt 17.0.1
@nuxtjs/prismic: "^1.4.2"
@prismicio/simulator: "^0.1.4"
@slicemachine/adapter-nuxt2: "^0.3.4
slice-machine-ui: "^1.5.1"

I was migrating slice-machine from 0.7 to 1.5.1
Slice machine work fine, but dev server is broken.

I can fix dependancies errors by manually installing slize-zone dependancy that is not found and removing slice-simulator.vue page (to resolve temporary @prismicio/simulator/kit not found issue), but now I have to following error: Cannot use import statement outside a module.

Did you find a way to resolve this @anton4 ?

@Priyanka Did you try to migrate an existing project with nuxt 2.15.8 and slice-machine 0.7 to slice-machine 1.5.1?

Thank you for your help ! :pray:

Ok, I manage to resolve the dependency error of slice-zone!

It was because I was still importing slize-zone in my pages from 'vue-slizezone' like this:

import SliceZone from 'vue-slicezone'

export default {
  components: {
    SliceZone
  },
  [...]

Slize-zone is now imported via @slicemachine/adapter-nuxt2 so we need to remove the import (nuxt will do the import automatically). I wish there were a better migration guide to switch to @slicemachine/adapter-nuxt2, there was some package to remove as well (nuxt-sm, @prismicio/slice-simulator-vue, vue-slicezone, etc).

I still have the same dependency error for @prismicio/simulator:

This dependency was not found:                                                                           
* @prismicio/simulator/kit in ./node_modules/@slicemachine/adapter-nuxt2/dist/simulator/SliceSimulator.cjs    
                                                                                                             
To install it, you can run: npm install --save @prismicio/simulator/kit

For now, I have removed slice-simulator.vue.
Obviously, the slice simaltor is not working but at least I can get my dev server running.

I have try to use node lts (v18.16.1) instead, but this don't fix the bug.

Any help would be appreciated @Priyanka.

Hello @poisson.miel

I am glad that the one issue has been resolved. Migration is always tricky.

For another issue, have you installed slice-simulator by running the command:

npm install --save-dev @slicemachine/adapter-nuxt

To use this adapter, have you specified it in the adapter property of your slicemachine.config.json file?

Have you also specified the adapter in the slice-simulator.vue file?

Thanks,
Priyanka

Hello! I have this same error in Nuxt 2, when I updated @slicemachine/adapter-nuxt2 to any version after 0.3.0. My dev server breaks with the message:

ERROR in ./node_modules/@slicemachine/adapter-nuxt2/dist/simulator/SliceSimulator.cjs
Module not found: Error: Can't resolve '@prismicio/simulator/kit' in '[my-project-folder]/node_modules/@slicemachine/adapter-nuxt2/dist/simulator'

The adapter is specified correctly in slicemachine.config.json. Slice Machine runs perfectly fine, except for the simulator.

This is how I'm importing the simulator in slice-simulator.vue:

import { SliceSimulator } from '@slicemachine/adapter-nuxt2/dist/simulator.cjs'

I backtracked from the latest adapter-nuxt2 release, 0.3.6, all the way to 0.3.0 and found that the error occurs in version 0.3.1 and above. For now, the only fix I found is manually setting the adapter version @ 0.3.0.

Any updates on this issue? I'm running Nuxt v2.17.0, and Node v18.16.0

1 Like

Same here ! If I manually set the adapter version to @0.3.0 it work.

@Priyanka Yes I have install @slicemachine/adapter-nuxt2, set it in slicemachine.config.json and I have the following import in my slice-simulator.vue: import { SliceSimulator } from '@slicemachine/adapter-nuxt2/dist/simulator.cjs'

Hello @poisson.miel @danyaviless18

Can you post the package.json file here? I will let my team know about the version and discuss it with them. I will come back to you with the update.

Thanks,
Priyanka

1 Like
"dependencies": {
    "@nuxtjs/axios": "^5.13.1",
    "@nuxtjs/sitemap": "^2.4.0",
    "core-js": "^3.8.3",
    "hooper": "^0.3.4",
    "mailgun.js": "^3.3.0",
    "nuxt": "^2.17.0",
    "nuxt-facebook-pixel-module": "^1.5.0",
    "nuxt-vuex-localstorage": "^1.2.8",
    "vee-validate": "^3.4.5",
    "vue-gtag": "^1.16.1",
    "vue-scrollto": "^2.20.0"
  },
  "devDependencies": {
    "@nuxtjs/eslint-config": "^5.0.0",
    "@nuxtjs/eslint-module": "^3.0.2",
    "@nuxtjs/google-fonts": "^1.2.0",
    "@nuxtjs/prismic": "^1.4.2",
    "@nuxtjs/svg": "^0.1.12",
    "@prismicio/simulator": "^0.1.4",
    "@slicemachine/adapter-nuxt2": "^0.3.7",
    "autoprefixer": "^10.4.14",
    "babel-eslint": "^10.1.0",
    "babel-loader": "^8.2.2",
    "eslint": "^7.18.0",
    "eslint-config-prettier": "^7.2.0",
    "eslint-plugin-nuxt": "^2.0.0",
    "eslint-plugin-prettier": "^3.3.1",
    "eslint-plugin-vue": "^7.5.0",
    "postcss": "^8.4.26",
    "prettier": "^2.2.1",
    "slice-machine-ui": "^1.6.0",
    "tailwindcss": "^3.3.3"
  }

Hello @poisson.miel

I am discussing this with my team and will let you know if/when there is any update.

Thanks,
Priyanka

2 Likes

I have the same error :frowning:

I'm on Nuxt 2, i followed the prismic install, and i have these error:

These dependencies were not found:                                                                                                                                                            friendly-errors 11:50:16  
                                                                                                                                                                                              friendly-errors 11:50:16  
* @prismicio/simulator/kit in ./node_modules/@slicemachine/adapter-nuxt2/dist/simulator/SliceSimulator.cjs                                                                                    friendly-errors 11:50:16  
* ~/slices in ./node_modules/babel-loader/lib??ref--2-0!./node_modules/vue-loader/lib??vue-loader-options!./pages/slice-simulator.vue?vue&type=script&lang=js&

For infos:
Node v16.14.2

Package:

{
  "name": "www",
  "version": "1.0.0",
  "private": true,
  "scripts": {
    "dev": "nuxt",
    "build": "nuxt build",
    "start": "nuxt start",
    "generate": "nuxt generate",
    "slicemachine": "start-slicemachine"
  },
  "dependencies": {
    "@nuxtjs/axios": "^5.13.6",
    "bootstrap": "^4.6.2",
    "bootstrap-vue": "^2.22.0",
    "core-js": "^3.25.3",
    "nuxt": "^2.15.8",
    "vue": "^2.7.10",
    "vue-server-renderer": "^2.7.10",
    "vue-template-compiler": "^2.7.10"
  },
  "devDependencies": {
    "@nuxtjs/prismic": "^1.4.2",
    "@prismicio/types": "^0.2.7",
    "@slicemachine/adapter-nuxt2": "^0.3.7",
    "slice-machine-ui": "^1.6.0"
  }
}

Node v18.16.0

The package file

"dependencies": {
    "@nuxtjs/axios": "^5.13.6",
    "@nuxtjs/pwa": "^3.3.5",
    "core-js": "^3.25.3",
    "nuxt": "^2.17.0",
    "nuxt-mq": "^3.0.0",
    "swiper": "^5.4.5",
    "vue": "^2.7.10",
    "vue-awesome-swiper": "^4.1.1",
    "vue-server-renderer": "^2.7.10",
    "vue-template-compiler": "^2.7.10",
    "vuelidate": "^0.7.7"
  },
  "devDependencies": {
    "@babel/eslint-parser": "^7.19.1",
    "@nuxt/image": "^0.7.1",
    "@nuxtjs/eslint-config": "^11.0.0",
    "@nuxtjs/eslint-module": "^3.1.0",
    "@nuxtjs/prismic": "^1.4.2",
    "@slicemachine/adapter-nuxt2": "^0.3.0",
    "eslint": "^8.24.0",
    "eslint-config-prettier": "^8.5.0",
    "eslint-plugin-nuxt": "^4.0.0",
    "eslint-plugin-prettier": "^4.2.1",
    "eslint-plugin-vue": "^9.5.1",
    "prettier": "^2.7.1",
    "slice-machine-ui": "^1.5.0"
  }

@Priyanka Hi ;)

I have the same issue. Should I create a new thread to get help?

Hi!

No solution for you? :(

Hello @anton4 @danyaviless18 @poisson.miel

I couldn't respond because I was off the last few weeks and will be off for more weeks in August.

Have you tried this solution in this thread: These dependencies were not found: @prismicio/simulator/kit - #5 by Vincent07

Thanks,
Priyanka

Hello! Sorry for the late response! Yes! This solution worked perfectly for me.

However, I've noticed that today, when starting a new project in Nuxt 2 with the setup command:

npx @slicemachine/init@latest as indicated here,

@prismicio/client and @prismicio/vue still have issues. They do go away with the fix.

As for the ~/slices error, it's a more understandable breaking error since it doesn't exist until a slice is created (or an empty slices/index.js file), which goes away easily.

But to have to implement a manual fix on @prismicio/client and @prismicio/vue imports for every new project can become a hassle. I hope the dev team can make this easier! In any case, the fix works for now, thank you so much for your response.

Thank you again @Priyanka @racheal.orukele for the solution!

Have a lovely day. :slight_smile: :sparkling_heart:

1 Like

Hello, @danyaviless18, Thanks for the feedback. I'll pass your feedback along with the team.