Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AxiosError: options must be an object #171

Closed
CKGrafico opened this issue Oct 18, 2022 · 5 comments · Fixed by #187
Closed

AxiosError: options must be an object #171

CKGrafico opened this issue Oct 18, 2022 · 5 comments · Fixed by #187
Assignees
Labels
help wanted [Contribution] Extra attention is needed

Comments

@CKGrafico
Copy link

CKGrafico commented Oct 18, 2022

This is possibly related to storyblok/storyblok-nuxt#210
When you start a new nuxt project its impossible to have it working.
The first error es that axios is not installed, after install it you will have that new error:

:
'AxiosError'
stack:
'AxiosError: options must be an object\n    at Object.assertOptions (file:///C:/Projects//NGO-HelpDev-Storyblok/node_modules/axios/lib/helpers/validator.js:67:11)\n    at Axios.request (file:///C:/Projects//NGO-HelpDev-Storyblok/node_modules/axios/lib/core/Axios.js:61:17)\n    at Axios.<computed> [as get] (file:///C:/Projects/l/NGO-HelpDev-Storyblok/node_modules/axios/lib/core/Axio…storyblok-vue.mjs:250:17)\n    at C:/Projects//NGO-HelpDev-Storyblok/node_modules/@storyblok/vue/dist/storyblok-vue.mjs:254:69\n    at new Promise (<anonymous>)\n    at X.i [as throttle] (C:/Projects//NGO-HelpDev-Storyblok/node_modules/@storyblok/vue/dist/storyblok-vue.mjs:253:12)\n    at C:/Projects//NGO-HelpDev-Storyblok/node_modules/@storyblok/vue/dist/storyblok-vue.mjs:532:28'
[[Prototype]]:
Error

image

As you can see seems that the real error comes from this package not nuxt package.

@aco228
Copy link

aco228 commented Oct 22, 2022

I am having the same issue:

code
: 
"ERR_BAD_OPTION_VALUE"
message
: 
"options must be an object"
name
: 
"AxiosError"
stack
: 
"AxiosError: options must be an object\n    at Object.assertOptions (https://127.0.0.1:5174/node_modules/.vite/deps/chunk-P6WNCWHP.js?v=61d1f5b8:1563:11)\n    at Axios.request (https://127.0.0.1:5174/node_modules/.vite/deps/chunk-P6WNCWHP.js?v=61d1f5b8:1615:25)\n    at Axios.<computed> [as get] (https://127.0.0.1:5174/node_modules/.vite/deps/chunk-P6WNCWHP.js?v=61d1f5b8:1692:17)\n    at Function.wrap [as get] (https://127.0.0.1:5174/node_modules/.vite/deps/chunk-P6WNCWHP.js?v=61d1f5b8:16:15)\n    at X.throttledRequest (https://127.0.0.1:5174/node_modules/.vite/deps/@storyblok_vue.js?v=88a8d76f:565:26)\n    at a (https://127.0.0.1:5174/node_modules/.vite/deps/@storyblok_vue.js?v=88a8d76f:268:17)\n    at https://127.0.0.1:5174/node_modules/.vite/deps/@storyblok_vue.js?v=88a8d76f:272:69\n    at new Promise (<anonymous>)\n    at X.i [as throttle] (https://127.0.0.1:5174/node_modules/.vite/deps/@storyblok_vue.js?v=88a8d76f:271:12)\n    at https://127.0.0.1:5174/node_modules/.vite/deps/@storyblok_vue.js?v=88a8d76f:552:28"
[[Prototype]]
: 
Error

on this piece of code from example:

<script setup>

import { useStoryblok } from '@storyblok/vue';
const story = await useStoryblok('home', { version: 'draft' });

</script>

and this are packages I am using:

    "@storyblok/vue": "^6.3.2",
    "@vitejs/plugin-basic-ssl": "^0.1.2",
    "axios": "^1.1.3",
    "bootstrap": "^5.2.1",
    "pinia": "^2.0.21",
    "primeicons": "^5.0.0",
    "primevue": "^3.17.0",
    "vue": "^3.2.38",
    "vue-axios": "^3.4.1",
    "vue-router": "^4.1.5"
  },
  "devDependencies": {
    "@vitejs/plugin-vue": "^3.0.3",
    "jsdom": "^20.0.0",
    "sass": "^1.55.0",
    "vite": "^3.0.9"
  }

update

I think I fixed it by downgrading axion lib to "axios": "^0.26.0"

@ralphjesy12
Copy link

same problem.

@patrykkurzeja91
Copy link

@CKGrafico Yeah, I just got similar problem with storyblok-nuxt. It turns out to be axios as You wrote in Your update. Actually [email protected] will do the trick!

Maybe it is a good time to update axios in storyblok?

@CKGrafico
Copy link
Author

thanks @patrykkurzeja91 can anybody in storyblok team give an official answer?

@Dawntraoz
Copy link
Contributor

Hi, folks @CKGrafico @patrykkurzeja91 @ralphjesy12 @aco228 👋
Sorry for the late reply. We were working on breaking changes.

Good news on this matter! We got rid of axios in the js-client, so now the @storyblok/vue SDK is updated with these changes in the last version, and the next one to be updated will be @storyblok/nuxt 🚀 Stay tuned and let us know if something pops up in the meantime 💜

@Dawntraoz Dawntraoz self-assigned this Dec 22, 2022
@Dawntraoz Dawntraoz added the help wanted [Contribution] Extra attention is needed label Dec 22, 2022
@Dawntraoz Dawntraoz linked a pull request Dec 22, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted [Contribution] Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants