Skip to content
Advertisement

Nuxt.js fails to start up with auth module

npx create-nuxt-app client and set it up. Run npm run dev and everything works.

I start auth setup with npm install @nuxtjs/auth

add '@nuxtjs/auth' module in nuxt.config.js

add example auth strategy like so

JavaScript

Add the example vue store and save it in store/index.js:

JavaScript

I run npm run dev, everything compiles and init message shows to go to http://localhost:3000/. Trying to load it in the browser, the URL continues to load after initial loading and does not end. Node process starts to use 100% of the CPU and after several minutes prints this and quits:

JavaScript

I tried this start to finish with node v10.15.3 and v12.18.3, the same result. Versions from package.json:

JavaScript

and npx create-nuxt-app --version shows create-nuxt-app/3.2.0 linux-x64 node-v12.18.3. OS is Solus 4.1 Fortitude.

What is going wrong here? If this is a known bug, are there versions/workaround that works?

Advertisement

Answer

Setting baseURL property under for axios in nuxt.config.js solved my issue:

JavaScript
Advertisement