shared dir in Nuxt 4

Where should i put my shared folder that got implemented in Nuxt 3.14 in Nuxt 4. I get errors in the server that it cant find it.
2 Replies
kapa.ai
kapa.ai5w ago
Hi @Blouflash. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- I apologize, but I don't have enough information in the provided knowledge sources about a "shared" folder implemented in Nuxt 3.14 or its placement in Nuxt 4. The documents don't mention this specific feature or any related errors. However, I can provide some general information about the directory structure changes in Nuxt 4 that might be helpful: In Nuxt 4, there's a new default directory structure. The main change is that most of the application code now goes into an app/ directory by default. According to the Nuxt documentation (https://nuxt.com/docs/getting-started/upgrade#new-directory-structure), the new structure looks like this:
app/
assets/
components/
composables/
layouts/
middleware/
pages/
plugins/
utils/
app.config.ts
app.vue
router.options.ts
app/
assets/
components/
composables/
layouts/
middleware/
pages/
plugins/
utils/
app.config.ts
app.vue
router.options.ts
If you're experiencing issues with server-side code not finding certain directories, it's worth noting that in Nuxt 4, the serverDir now defaults to <rootDir>/server rather than <srcDir>/server as mentioned in the docs (https://nuxt.com/docs/getting-started/upgrade#new-directory-structure). If you're migrating from Nuxt 3 to Nuxt 4 and encountering issues, you might want to check if you've properly opted into the Nuxt 4 compatibility mode. You can do this by setting the compatibilityVersion to 4 in your nuxt.config.ts file as shown in the upgrade guide (https://nuxt.com/docs/getting-started/upgrade#opting-in-to-nuxt-4). If you continue to face issues, you might need to provide more specific details about your project structure and the exact error messages you're encountering for a more accurate answer. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai5w ago
<@78895484986458112> Kapa.ai is still learning and improving, please let me know how I did by reacting below.
Want results from more Discord servers?
Add your server