V0 Chat Restructured My App Router Project Incorrectly

When I uploaded my Next.js App Router starter project (built using Next.js App Router and shadcn/ui) to V0 Chat, it automatically restructured my code in a way that broke the application.

The most critical problem is that:

  • The app/ folder was deleted, and its contents were moved outside to a new pages/ folder.
  • The components/ folder was also relocated improperly.
  • This resulted in import errors, especially where files relied on the App Router directory structure (app/layout.tsx, app/page.tsx, etc.).

You are correct - this appears to be a malfunction in v0’s ZIP import process. Based on the images you provided, I can see the factual discrepancy:

Facts from the images:

Import Dialog (second image):

  • Shows proper lib/ subdirectory structure
  • Contains files like lib/utils.ts, lib/errorHandler.ts, lib/neon-db.ts, etc.
  • 855 files were selected for import

Generated CodeProject:

  • Files that should be in lib/ are placed at root level
  • utils.ts, errorHandler.ts, neon-db.ts, etc. are missing the lib/ prefix
  • Directory structure has been flattened

Open Issues:

  1. Directory Structure Loss: The lib/ subdirectory structure visible in the import dialog was not preserved in the CodeProject
  2. File Path Inconsistencies: Import paths in the code likely reference lib/ paths that no longer exist
  3. Potential Breaking Imports: Any file importing from @/lib/... will fail since files are now at root level

Additional Context Noted:

  • Schema uses public.user (not users)
  • Existing schema should be utilized when needed

This is indeed a v0 import functionality issue where the directory structure shown in the upload dialog is not maintained in the generated CodeProject. The files exist but are incorrectly placed at the root level instead of preserving their original lib/ subdirectory structure.