TS support - File '.../node_modules/vue-speedometer/dist/index.d.ts' is not a module
aurelienroux opened this issue · comments
Hi,
I'm having a problem using the lib in a TS app. Importing the lib in a component returns an error as it is not a module.
import VueSpeedometer from 'vue-speedometer' //File '/.../node_modules/vue-speedometer/dist/index.d.ts' is not a module.
...
components: {
VueSpeedometer
},
...
Note that the component still displays correctly with the gauge working, but deployment breaks because of the following errors.
ERROR in /opt/atlassian/pipelines/agent/build/node_modules/vue-speedometer/dist/index.d.ts(44,27):
44:27 Cannot find namespace 'React'.
42 | }
43 |
> 44 | const ReactSpeedometer: React.FunctionComponent<Props>
| ^
45 |
46 | export default ReactSpeedometer
47 | }
error in /opt/atlassian/pipelines/agent/build/src/components/Card/Signal/Quality.vue
ERROR in /opt/atlassian/pipelines/agent/build/src/components/Card/Signal/Quality.vue(73,28):
73:28 File '/opt/atlassian/pipelines/agent/build/node_modules/vue-speedometer/dist/index.d.ts' is not a module.
71 | <script lang="ts">
72 | import Vue from 'vue'
> 73 | import VueSpeedometer from 'vue-speedometer'
| ^
74 | import { mapState } from 'vuex'
75 | import { IStateThing } from '@/store/modules/thing'
76 |
Looking at the index.d.ts
in the library, I can see that it exports a ReactSpeedometer based on this declaration
const ReactSpeedometer: React.FunctionComponent<Props>
export default ReactSpeedometer
Am I missing something here to make it work ?
thanks in advance
Here is the app config
vue: ^2.6.10
typescript: ~3.5.3
vue-speedometer": ^1.2.0
@aurelienroux Thanks for brining this to notice ... I will address this issue as soon as possible and update here
@aurelienroux This issue is addressed in v1.2.1
. Please upgrade to this version (1.2.1
) and see if it addresses your problem. Please update here if your issues are fixed so that this issue can be closed.
@aurelienroux Please reopen if you find problems with v1.2.1
.
Yep, it's fixed. thanks for the quick response