-
Notifications
You must be signed in to change notification settings - Fork 925
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
$axios is not available #56
Comments
Im not sure why this is happening but did you add axios to the modules before auth? like so:
|
Yes exactly did like that ! |
Thats about all i can help. How about trying a fresh empty nuxt project and install auth immediately after and see if you get a problem, this should narrow down the cause. if it does work maybe then maybe in your current project something is wrong in the nuxt config or code you wrote Is the error from code you've written or is it internal? |
It's an error from the auth-module, in auth.class, because Axios is probably not loaded in the app, but why... Trying to install a fresh nuxt install to check, thanks for your help anyway ;) |
Well, tried this on a fresh new app, and It's doing the same thing! |
What do you have in package.json in |
That's the fresh new app |
ok everything seems fine! Are you using a nuxt template or you are doing it from scratch In my case i am using the starter template from https://github.com/nuxt-community/starter-template and it works |
Using the starter template on my main app, not working too ^^ |
lol ok i don't know anymore, update everything :D npm, vue-cli, node mayble clone this https://github.com/nuxt-community/auth-module/tree/master/example/with-vanilla-nuxt and use it as your base template. |
For some bizarre reason it seems you have to add axios last (opposite of what it says in doc):
|
Nice !! But strange 👍 Thanks you, should have test it before posting there lol |
Hey. Thanks for reporting. This is super strange. With the latest release, it should automatically insert itself just after axios. source (And also tests are doing the same order. Actually order shouldn't matter) Would you please share contents of |
Hey, No problem ! Here is the index.js file with axios as first : Looks like axios plugin is imported after Auth one, when Axios is after, in index.js he's imported before auth plugin! |
Ah, i got it! Windows backslash problem again! Will resolve it soon. |
Well yeah, sorry for using windob :D |
Thanks for finding the problem. I'm running into this, with the latest published release. |
The fix with the order of the imports from @zalmane still works. "dependencies": {
"@nuxtjs/auth": "^4.0.0-rc.3",
"@nuxtjs/axios": "^5.0.1",
"@nuxtjs/vuetify": "^0.4.0",
"axios": "^0.18.0",
"nuxt": "^1.0.0",
"vuetify": "^1.0.0"
}, Node: v8.9.3 npm 5.6 |
Closing as solved by be1bed2. |
I'm still getting the same error on windows
|
@g0shed What version are you using? I don't think we've had an NPM push in a while. A few bugs are fixed and just waiting for an NPM push. |
`` |
Hello guys,
Someone faced this error on nuxt ? I've added the 2 modules to nuxt.config.js and the auth module return me this error with !this.app.$axios...
Thanks for your response..
NeOMakinG
The text was updated successfully, but these errors were encountered: