sfxcode / vite-primevue-starter

VUE 3 Starter project for using primevue 3 with Vite 3 - Pages, Layouts, Validation
https://vite-primevue-starter.netlify.app/
MIT License
132 stars 31 forks source link

globEager is deprecated, causes error #80

Closed robinzimmermann closed 11 months ago

robinzimmermann commented 12 months ago

In main.ts, Visual Code says that globEager is deprecated:

image

(Ignore the red squiggle underneath the i, but it is annoying that this part of the code is not typed, grr!)

At runtime, the app doesn't start and the following error is in the Javascript console:

image

The app fails to load. I started it using pnpm run dev from the command line.

robinzimmermann commented 12 months ago

(BTW, thank you for an excellent starter project template!)

robinzimmermann commented 12 months ago

I have temporarily worked around the issue:

// register vue composition api globally
import { ViteSSG } from "vite-ssg";
import generatedRoutes from "virtual:generated-pages";
import { setupLayouts } from "virtual:generated-layouts";
import App from "./App.vue";
import "uno.css";
import "@sfxcode/formkit-primevue/dist/sass/formkit-primevue.scss";
const modules = import.meta.glob("./modules/*.ts", { eager: true });

const routes = setupLayouts(generatedRoutes);

export const createApp = ViteSSG(App, { routes }, (ctx) => {
  // install all modules under `modules/`
  Object.values(modules).map((i: any) => i.install?.(ctx));
});

But I have no idea what the correct solution should be.

sfxcode commented 11 months ago

Good morning Robin,

try to fix with latest release. Please give it a try to see if it solves your problem.

Greetings, Tom

robinzimmermann commented 11 months ago

I believe it's working, thank you for the quick response!

robinzimmermann commented 11 months ago

(I'm not sure if I should close the ticket or let someone else do it...)