wheatjs / vite-plugin-vue-type-imports

Import types in Vue SFC for defineProps
223 stars 16 forks source link

Sourcemaps generation #37

Closed r9mp closed 1 year ago

r9mp commented 1 year ago

Hi

Following the issue nuxt/framework#36 .

It seems that the current state of vite-plugin-vue-type-imports does not generate sourcemaps.

I tryed to make this plugin work with Vitest & Nuxt 3 and found two problems:

You can find a repo to reproduce it here: https://github.com/r9mp/vitest-nuxt

The problem only occurs on the file test/nuxt.spec.ts and when the setup function is called. If you comment it, the problems stop.

To reproduce, just clone the repo git clone https://github.com/r9mp/vitest-nuxt, then yarn install, and yarn test to launch the tests in verbose mode.

R

Zolyn commented 1 year ago

After applying vitest --run, the process does not stop anymore once done ; and it seems that the process is executed twice (or there is something weird... but don't really know what).

I can't reproduce.

r9mp commented 1 year ago

I deleted node_modules/, yarn install, yarn test, and same result. I'm on Windows 10, the error is the following:

image

image

On which OS are you? I can try to reproduce on Ubuntu if you want.

Zolyn commented 1 year ago

I can reproduce it on Windows 11, but not on Arch Linux.

Seems to be an upstream bug. See https://github.com/nuxt/nuxt.js/issues/15065

Zolyn commented 1 year ago

I cloned https://github.com/manniL/nuxt-test-utils-vitest-windows and removed the call of useTextContext. The problem still exists, so I think it's an upstream bug.

Zolyn commented 1 year ago

Sourcemaps generation is now supported in v0.2.3

r9mp commented 1 year ago

Works for me! Thanks a lot @Zolyn !