nuxt-modules / leaflet

A Nuxt module to use Leaflet
https://leaflet.nuxtjs.org/
Apache License 2.0
122 stars 4 forks source link

bug: regression on nuxt@3.13.2 breaking the entire module #80

Closed tobychidi closed 1 week ago

tobychidi commented 2 months ago

The requested module '/_nuxt/@fs/C:/Users/tobychidi/Documents/GitHub/kaycee/Rotabliss/nodemodules/.pnpm/@vue-leaflet+vue-leaflet@0.10.1@types+leaflet@1.9.12_leaflet@1.9.4_typescript@5.6.2/node_modules/@vue-leaflet/vue-leaflet/dist/vue-leaflet.cjs.js?v=6cbe18fd' does not provide an export named 'LTileLayer'

image

Gugustinette commented 2 months ago

Ooh that's weird, can you provide a reproduction ?

urbgimtam commented 2 months ago

Suffering the same after updating to nuxt@3.13.2.

Reproduction

urbgimtam commented 2 months ago

Forcing nuxt@3.13.1 does not trigger error. Only 3.13.2

cesxhin commented 2 months ago

same problem, after updating to nuxt@3.13.2

Gugustinette commented 2 months ago

After further investigations, I think this is more or less due to this fix from nuxt@3.13.2.

But I'm really not sure what should be changed on the module side, this is how components from vue-leaflet are imported :

for (const component of components) {
  addComponent({
    name: component,
    export: component,
    filePath: '@vue-leaflet/vue-leaflet',
    chunkName: `nuxt-leaflet/${component}`,
    mode: 'all',
  })
}

@danielroe any suggestion on this ?

You can develop on the module playground directly here : https://stackblitz.com/~/github.com/nuxt-modules/leaflet and try to navigate to /map/map path, which displays the following error : Capture d’écran 2024-09-17 aΜ€ 14 36 20

danielroe commented 2 months ago

yes, this is a nuxt bug.

Gugustinette commented 2 months ago

Re-opening until the fix is released, for now stick with nuxt@3.13.1

ipanamski commented 2 months ago

Is the fix going to be included in the next release or the current one 3.13.2?

Gugustinette commented 2 months ago

@ipanamski You'll have to wait for a new release, I'll update this issue when it is available πŸ‘

urbgimtam commented 2 months ago

It may be interesting to remind that it can be mitigated by wrapping <NuxtErrorBoundary> around your component which holds <LMap>, and even pass alternative content with <template #error={error}></template>.

Never used NuxtErrorBoundary much, but its really interesting as it can save the page from breaking in these kind of scenarios. Lovely stuff!

Gugustinette commented 1 month ago

Looks like this will be fixed on v3.14.0 : https://github.com/nuxt/nuxt/pull/29077

Gugustinette commented 1 week ago

Nuxt v3.14.0 was released, and Nuxt Leaflet 1.2.4 should be updated with it πŸ‘

Gugustinette commented 1 week ago

As far as I tested, this seems resolved with Nuxt Leaflet 1.2.4.

@tobychidi can you confirm ?

Niki2k1 commented 1 week ago

Not op but I can confirm, works with 3.14 on my end πŸ‘πŸΌ

tobychidi commented 1 week ago

The issue has been resolved. Thank you @Gugustinette

Gugustinette commented 1 week ago

Cool ! Thanks a lot everyone πŸ‘