AlexLavoie42 / Nuxt-Mapbox

Elegant Mapbox integration with Nuxt
81 stars 11 forks source link

`error TS7016: Could not find a declaration file for module 'mapbox-gl'` When using `typescriptBundlerResolution` #97

Open AlexLavoie42 opened 6 months ago

eladcandroid commented 5 months ago

Do we have any solution or patch? I have build errors

AlexLavoie42 commented 5 months ago

Not that I have been able to find yet. I believe the issue is related to mapboxgl types not having been updated to 3.x since the issue started around that update. This is also blocking my latest update unfortunately since it breaks ci.

For now disabling typescriptBundlerResolution may fix the errors.

miket2marcom commented 5 months ago

I started getting this error recently too. Are there any workarounds?

AlexLavoie42 commented 5 months ago

I started getting this error recently too. Are there any workarounds?

Unfortunately nothing that works consistently yet. This issue is also blocking #101 so if anyone has an idea of the cause it would be extremely helpful.

robigan commented 1 month ago

Getting this issue as well, I'd have no idea how to fix things myself

robigan commented 1 month ago

Not that this is causing any build errors for me interestingly enough but IntelliSense isn't working

robigan commented 1 month ago

I started getting this error recently too. Are there any workarounds?

A proper but more tedious workaround would be to use /// <reference types="mapbox-gl" /> to explicitly import the types under the namespace mapboxgl and then use that namespace to provide typings to your imports. Another way which I think is possible is to declare a project wide something.d.ts, pull in the references and then use declare module 'mapbox-gl to reference the DT references within that declare module.