I encountered the exact same error after going from node 16 to node 20 and having @nuxtjs/tailwindcss
being updated form v5.0.0 to v5.3.5.
FATAL nuxt.options._layers is not iterable
at installModule (node_modules/@nuxt/kit/dist/index.mjs:2409:32)
at async setup (node_modules/@nuxtjs/tailwindcss/dist/module.mjs:92:7)
at async ModuleContainer.normalizedModule (node_modules/@nuxt/kit/dist/index.mjs:2112:17)
at async ModuleContainer.addModule (node_modules/@nuxt/core/dist/core.js:167:20)
at async ModuleContainer.ready (node_modules/@nuxt/core/dist/core.js:34:7)
at async Nuxt._init (node_modules/@nuxt/core/dist/core.js:344:5)
I checked the Github repo (https://github.com/nuxt-modules/tailwindcss) and found out that v6 is available (6.11 already at time of writing).
So I switched to @nuxtjs/tailwindcss
v6 and this error was gone:
$ yarn add --dev @nuxtjs/tailwindcss@^6
or
$ npm install --save-dev @nuxtjs/tailwindcss@^6