Auth-module: New Nuxt install problems

Created on 26 Mar 2018  路  8Comments  路  Source: nuxt-community/auth-module

I created a new project with the latest version of Nuxt. All working nicely. I added the auth module and after adding the module definitions to the config file I get a 404.

  modules: [
    '@nuxtjs/axios',
    '@nuxtjs/auth',
  ],

Is there an issue with the latest version of Nuxt?

This question is available on Nuxt.js community (#c76)

Most helpful comment

I just stumbled upon this problem as well when updating nuxt itself (from 1.0.0 to 1.4.0). Scrolling up in my terminal it threw an error when I wouldn't have an index.js file in my store/ folder:

Error: [Auth] Enable vuex store by creating store/index.js

The index.js file can be empty, it just have to be there.

I'm not entirely sure if this is the same problem, but at least you could try if this works. @shealan

All 8 comments

@shealan Could you post the terminal output?

No console errors but page gives me the following error

Cannot GET /

Commenting out the auth module in the config fixes the issue and I see the index.vue page as expected.

Dependencies in package.json on the new project look like this:

  "dependencies": {
    "@nuxtjs/auth": "^4.0.0-rc.3",
    "@nuxtjs/axios": "^5.1.1",
    "nuxt": "^1.4.0"
  },

I just stumbled upon this problem as well when updating nuxt itself (from 1.0.0 to 1.4.0). Scrolling up in my terminal it threw an error when I wouldn't have an index.js file in my store/ folder:

Error: [Auth] Enable vuex store by creating store/index.js

The index.js file can be empty, it just have to be there.

I'm not entirely sure if this is the same problem, but at least you could try if this works. @shealan

@Fubinator that was exactly it, thank you. I'll submit a pull request on the docs.

Whenever you use @nuxtjs/auth module, you have to activate the store. This means you have to to create a folder called store and put inside it at least an empty file called index.js .
Billal Begueradj

Do I need to create store folder and index.js? Has this rule changed now?

@begueradj it's worked for me, Thank you.

just create index.js inside store folter, Work perfectly!!!

Was this page helpful?
0 / 5 - 0 ratings