New Nuxt install problems

shealan
0
shealan
commented 2 years ago

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?

0
Fubinator
35
Fubinator
commented 2 years ago

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

1
derevandal
50
derevandal
commented 2 years ago

@shealan Could you post the terminal output?

1
shealan
0
shealan
commented 2 years ago

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"
  },
0
Fubinator
35
Fubinator
commented 2 years ago

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

1
shealan
0
shealan
commented 2 years ago

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

0
begueradj
40
begueradj
commented 8 months ago

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

0
love8587
0
love8587
commented 5 months ago

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

0
najihoussam
0
najihoussam
commented 4 months ago

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

0
Informations
Question โ€ข Resolved
#c76 - Created 2 years ago