vuetifyjs/create

[Bug Report][3.5.2] "npm create vuetify" does not produce working project

carchrae opened this issue · 4 comments

Environment

Vuetify Version: 3.5.2
Vue Version: 3.3.0
Browsers: Chrome 121.0.0.0
OS: Linux x86_64

Steps to reproduce

npm create vuetify
then choose

  • preset "Base"
  • typescript "No"
  • "npm"

Expected Behavior

A working Hello World project

Actual Behavior

fails to run.

Error: The following dependencies are imported but could not be resolved:

virtual:generated-layouts

Reproduction Link

  • no link

Other comments

This bug is in npm create vuetify - so, sorry about the bogus repro link. I'm not sure how else to report this, but the dev experience of using the starter command and having an error is poor, so I presume is something you would care to know about.

#16 - seems like it might be related.

removing the import and reference fixes the issue. i'm not familiar with virtual:generated-layouts which i guess is part of the router framework being used here. clearly i need to learn what this is and how to fix it.

import { setupLayouts } from 'virtual:generated-layouts'

it appears that the import i deleted above is old cruft from using a different router framework (https://github.com/JohnCampionJr/vite-plugin-vue-layouts) so it can/should be deleted. i'm unclear if the create-vuetify is actually configuring the new framework correctly, but the instructions to configure it are here: https://github.com/posva/unplugin-vue-router

It seems the new plugins are missing a bunch of tsconfigs and instructions and it is breaking typescript. Here is what fixed for me:

  1. tsconfig needs this added: "types": ["vite-plugin-vue-layouts/client", "unplugin-vue-router/client"]
  2. tsconfig need to include *.d.ts files in the root, not just /src
  3. unplugin-vue-router requires us to first run npm run dev before npm run build. This is to generate the route types.

This is resolved as of the latest release. Thank you for your patience.