Unauthorized when running Slice Machine, trying to add my own slices to my CMS

Hello all,

Getting up to speed with Prismic and Slice machine which looks awesome. I'm now exploring building my own slices.

I'm having a few teething issues launching Slice Machine.

When running prismic sm --develop I receive the following error [slices API]: Unauthorized

Story block is running in another terminal window.
I am signed into Prismic CLI and have tried to re-enter my details with no joy (same error as above)

Any tips to where I may be going wrong?

Thanks
Jake

Hello Jake, thanks for reaching out!

I'd like to reproduce this issue on my side
Could you help me detailing the steps you took to found the error?
First checks we can do are:

  • Before which step did you ran prismic logout and prismig login again?
  • Try deleting your node_modules and re installing

All additional details of your configuration will be helpful.

Since we're still in the beta version of Slice Machine, we don't have most the use cases documented yet. So it'll be good to troubleshoot this together!

Thanks for getting back to me Paulina :slight_smile: ,

I have deleted node modules and installed again successfully with same issue.

I noticed when I run Storyblock it updates the main.js line to this: stories: ['../../components/**/*.stories.@(ts|js)'],

Which means I've had to create a new file inside components to link my slices.

Additional info:
This was an already setup Nuxt site that I built with Strapi, I have been migrating to Prismic.
All of the Apollo GraphQL and Strapi code had been removed in favour of Prismic + asyncdata.
I've had no issues in setting things up till this point.

Packages:
"dependencies": {
"@nuxt/content": "^1.8.1",
"@nuxtjs/apollo": "^4.0.1-rc.3",
"@nuxtjs/axios": "^5.12.2",
"@nuxtjs/prismic": "^1.2.4",
"@nuxtjs/pwa": "^3.0.2",
"@prismicio/vue": "^2.0.7",
"core-js": "^3.6.5",
"graphql-tag": "^2.11.0",
"nuxt": "^2.14.5",
"nuxt-sm": "0.0.6",
"prismic-cli": "^3.7.11",
"prismic-javascript": "^2.7.1",
"prismic-vue": "^2.0.1",
"vue-essential-slices": "^0.2.0",
"vue-slicezone": "0.0.28"
},
"devDependencies": {
"@nuxtjs/eslint-config": "^3.1.0",
"@nuxtjs/eslint-module": "^2.0.0",
"@nuxtjs/storybook": "^2.2.2",
"@nuxtjs/stylelint-module": "^4.0.0",
"@nuxtjs/tailwindcss": "^3.0.2",
"@vue/test-utils": "^1.1.0",
"babel-core": "7.0.0-bridge.0",
"babel-eslint": "^10.1.0",
"babel-jest": "^26.3.0",
"eslint": "^7.8.1",
"eslint-plugin-nuxt": "^1.0.0",
"jest": "^26.4.2",
"node-sass": "^5.0.0",
"sass-loader": "^10.0.5",
"slice-machine-ui": "0.0.38",
"stylelint": "^13.7.0",
"stylelint-config-standard": "^20.0.0",
"vue-jest": "^3.0.4"
}

Update:
I have tried logging out and back in again with no success.

  • Is Slicemachine installed and configured in your project? (I assume it is)
    How can I check this? It looks to be and the sm.json is correct (with correct CMS endpoint)

Thanks again
Jake

I gave up trying to get my previous Nuxt project working and started from scratch with a new Nuxt install + updated to Node 14 and I'm in and working! with Storybook and Slice machine running as expected! :sunglasses:

1 Like

This issue has been closed due to inactivity. Flag to reopen.