Nuxt layouts for new install & error Component name "default" should always be multi-word

Published Jul 15, 2022
Updated Jul 15, 2022
By Simon

When setting up a Nuxt for the first time and wanting to use a layout to add a persistent nav element to my application I got the following error after creating a new layouts directory in the root with a default.vue.

  1:1 error Component name "default" should always be multi-word vue/multi-word-component-names

What happens when you use npm run dev with a Nuxt app that doesn't have the layouts directory is Nuxt creates it in the .nuxt directory. So you either need to remove the .nuxt/layouts directory with the default.vue and recreate it in the root or move the generated version to the root. Make your modifications and then stop the dev command with ctrl C then run npm run dev again.

This isn't clearly explained on the layouts directory page that you actually have to manually create it before running your dev server but this seems to work for me. Now you can use layouts with your application.

Nuxt @ v2.15.8