diegoazh / gmap-vue

A wrapper component for consuming Google Maps API built on top of Vue. Fork of the popular vue-google-maps plugin.
https://diegoazh.github.io/gmap-vue/
173 stars 51 forks source link

Need help on: failed to scan for dependencies from entries #316

Closed Tuhtarov closed 6 months ago

Tuhtarov commented 6 months ago

When I try to import the MapLayer type then I get the following error in the console:

Error: Failed to scan for dependencies from entries: ✘ [ERROR] No known conditions for "./components" specifier in "@gmap-vue/v3" package [plugin vite:dep-scan]

script:~/src/components/desktop/settings/MapPage.vue?id=0:54:7:
  54 │ import '@gmap-vue/v3/components'
     ╵        ~~~~~~~~~~~~~~~~~~~~~~~~~

This error came from the "onResolve" callback registered here: node_modules/esbuild/lib/main.js:1293:20: 1293 │ let promise = setup({

Steps to reproduce

Just import some type from v3/components

Os

Plugin version

I use TS 5.2.2, Vue 3.4 and Vite 5.2.0

Also i have this vite config segment:


 base: `./`,
  resolve: {
    alias: {
      "@": fileURLToPath(new URL("./src", import.meta.url)),
      "@store": fileURLToPath(new URL("./src/app/store", import.meta.url)),
    },
  } 
  }```

And this TS config:
```{
  "compilerOptions": {
  ///
    "paths": {
      "@store/*": ["src/app/store/*"],
      "@service/*": ["src/app/service/*"],
      "@/*": ["src/*"],
    },
    }```
diegoazh commented 6 months ago

Hi @Tuhtarov, can you provide a minimum reproduction repo? The repo is very useful to understand what you are trying to do.

Remember that '@gmap-vue/v3/components' only export types, not real classes. I never tried to import all types in that way import '@gmap-vue/v3/components', I only imported them individually like the following example import {Map, Marker} from '@gmap-vue/v3/components'.

Could you open a discussion on this repo? questions and help should happen in discussions, not on issues. I'm going to remove this template issue in a few days. Thank you.

Tuhtarov commented 6 months ago

@diegoazh, sorry for the trouble, the problem went away after reinstalling node_modules. Thank you