You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Property <<plugin name>> does not exist on type 'Plugins' #266
Hey! I'm creating a new plugin for the analytics lib :)
It's almost ready to be published, but I'm getting this Typescript error when calling custom methods in my plugin:
I'm uncertain if that's something I missed in my configuration, or if that's something we can improve in the main analytics lib. I can prepare a PR here too.
Using namespace and interface merging via globals is how my team accomplished this. We did unfortunately have to coerce to get it working if did some wrapping you could be probably get it to override directly.
Activity
DavidWells commentedon Apr 3, 2022
Mmmm not sure how exactly you'd type this.
Suggestions welcome.
wlecki commentedon Jun 14, 2022
Hey :)
So I've found this script to generate typing, but I have hard time understanding it (thus, creating a PR): https://github.com/DavidWells/analytics/blob/e324d0c97797c5d661bb11c8f2014e05cb639564/packages/analytics-core/scripts/types.js
But the simplest solution would be to allow
Recordforpluginsproperty onAnalyticsInstancelike this:Now
pluginsproperty is typed like this:plugins: Plugins;shafferchance-lulu commentedon Aug 26, 2022
Using namespace and interface merging via globals is how my team accomplished this. We did unfortunately have to coerce to get it working if did some wrapping you could be probably get it to override directly.
shafferchance-lulu commentedon Aug 26, 2022
It would be a combination of @wlecki and a global declaration file.
wlecki commentedon Jan 12, 2023
@shafferchance-lulu could you please share a snippet of our namespace and interface merging via globals? Thanks!
deevus commentedon Jan 25, 2024
Vite does a similar thing: https://vitejs.dev/guide/env-and-mode