vite/vue3, import.meta.glob broken after node upgrade

25 Views Asked by At

In my code I have

const all = import.meta.glob('@/components/*.vue')

which has been working fine, until I had to upgrade from node 16 to node 20. Now when I try to 'npm run dev' I get

Failed to resolve import "../../../../../../../c:/development/" etc

It would seem something broke with resolving paths. Making some weird absolute/relative hybrid. I've been trying a bunch of different things, but can't seem to get it to work again.

My vite.config.ts has the

resolve: {
  alias: {
    '@': fileURLToPath(new URL('./src', import.meta.url))
  }
}

I would assume it's something to do with this area? maybe? except, if I try

const all = import.meta.glob('/src/components/*.vue')

it still has the same result

0

There are 0 best solutions below