vue-scrollto
vue-scrollto copied to clipboard
Error during build (Typescript version)
When I do npm run serve
, I do not see any issues but when I build the application with npm run build
, I get the following error:
42:22 Could not find a declaration file for module 'vue-scrollto'. '/Users/project/node_modules/vue-scrollto/vue-scrollto.js' implicitly has an 'any' type.
Try `npm install @types/vue-scrollto` if it exists or add a new declaration (.d.ts) file containing `declare module 'vue-scrollto';`
> 42 | import ScrollTo from 'vue-scrollto';
| ^
43 |
44 | @Component({
45 | components: {
ERROR Build failed with errors.
It means you don't have the correct typings.
To fix this, install them like this: npm install --save-dev @types/vue-scrollto
@types/vue-scrollto
is a stub package, which claims that vue-scrollto
provides type definitions itself.
@types/vue-scrollto
is a stub package, which claims thatvue-scrollto
provides type definitions itself.
https://github.com/rigor789/vue-scrollto/blob/master/vue-scrollto.d.ts
I had to add vue-scrollto
to the types
configuration in my tsconfig.json
file for Typescript to pick it up. That isn't normal for a package that provides its own type definitions.