As I make the transition from Nuxt 2 to Nuxt 3 for a large application, I began by setting up a fresh Nuxt 3 project and transferring code over. However, an issue arose when working with my old middleware array in the nuxt.config.js
file. Here's what I encountered:
export default defineNuxtConfig({
// ... some other configs
router: {
middleware: ["redirect", "authenticated"],
// The line above is causing an error stating that this option does not exist
base: `${process.env.ROUTER_BASE}`,
},
In my project structure, I already have a middleware folder, but I am unsure of how to properly define it in the configuration file. In the past, in Nuxt 2, I faced issues where I needed to specify the order in which middleware functions were executed. To address this, I had set the order in my middleware array. I am seeking similar functionality in Nuxt 3, yet I have been unable to locate documentation on this aspect of the migration process.